[wwwsearch-commits] r22967 - wwwsearch/mechanize/trunk/mechanize

jjlee at codespeak.net jjlee at codespeak.net
Fri Feb 3 00:54:59 CET 2006


Author: jjlee
Date: Fri Feb  3 00:54:57 2006
New Revision: 22967

Modified:
   wwwsearch/mechanize/trunk/mechanize/_mechanize.py
Log:
Simplify args processing a bit

Modified: wwwsearch/mechanize/trunk/mechanize/_mechanize.py
==============================================================================
--- wwwsearch/mechanize/trunk/mechanize/_mechanize.py	(original)
+++ wwwsearch/mechanize/trunk/mechanize/_mechanize.py	Fri Feb  3 00:54:57 2006
@@ -54,14 +54,12 @@
 # idea for this argument-processing trick is from Peter Otten
 class Args:
     def __init__(self, args_map):
-        self._args = dict(args_map)
+        self.dictionary = dict(args_map)
     def __getattr__(self, key):
         try:
-            return self._args[key]
+            return self.dictionary[key]
         except KeyError:
             return getattr(self.__class__, key)
-    def dictionary(self):
-        return self._args
 
 def form_parser_args(
     select_default=False,
@@ -363,7 +361,7 @@
         args = form_parser_args(*args, **kwds)
         if args.form_parser_class is None:
             args.form_parser_class = ClientForm.RobustFormParser
-        FormsFactory.__init__(self, **args.dictionary())
+        FormsFactory.__init__(self, **args.dictionary)
 
 def bs_get_title(response, encoding):
     import BeautifulSoup


More information about the wwwsearch-commits mailing list