Revision: 4135 Author: btongminh Date: 2007-08-29 19:46:50 +0000 (Wed, 29 Aug 2007)
Log Message: ----------- Add persitent_http as a config setting.
Modified Paths: -------------- trunk/pywikipedia/config.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/config.py =================================================================== --- trunk/pywikipedia/config.py 2007-08-29 19:43:26 UTC (rev 4134) +++ trunk/pywikipedia/config.py 2007-08-29 19:46:50 UTC (rev 4135) @@ -359,6 +359,12 @@
copyright_economize_query = True
+############## HTTP SETTINGS ############## +# Use a persistent http connection. An http connection has to be established +# only once per site object, making stuff a whole lot faster. Do NOT EVER +# use this if you share Site objects across threads without proper locking. +persistent_http = False + ############## FURTHER SETTINGS ##############
# The bot can make some additional changes to each page it edits, e.g. fix
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-08-29 19:43:26 UTC (rev 4134) +++ trunk/pywikipedia/wikipedia.py 2007-08-29 19:46:50 UTC (rev 4135) @@ -3131,6 +3131,7 @@ if not language[0].upper() + language[1:] in self.namespaces(): self._validlanguages.append(language)
+ if persistent_http is None: persistent_http = config.persistent_http self.persistent_http = persistent_http and self.protocol() in ('http', 'https') if persistent_http: if self.protocol() == 'http':