From 960a4df215aec8dc13ab375589ebb5dabcfe5725 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Fri, 22 Jan 2010 15:45:54 -0200 Subject: [PATCH] renamed Network_Manager to simply NetworkManager, since we expect all the networks to use it, so it will be easier to type --- mitterlib/network/__init__.py | 12 ++++++------ mitterlib/network/twitter.py | 2 +- mitterlib/ui/ui_pygtk.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mitterlib/network/__init__.py b/mitterlib/network/__init__.py index 785a3d1..a2b958e 100644 --- a/mitterlib/network/__init__.py +++ b/mitterlib/network/__init__.py @@ -42,8 +42,8 @@ have the following options: case the next network causes Mitter to crash or something related.) A value of 0 means the Network Manager will save the config file after each round of requests to all networks (failing or succeding); for devices that use flash - drives as storage, it's recommended some large value (since those devices - have a defined number of writes as lifetime.) Default is '5'. + drives as storage, it's recommended some large value (since those storage + devices have a lifetime based on the number of writes.) Default is '5'. """ #-------------------------------------------------------------------- @@ -140,7 +140,7 @@ class Networks(object): def _save(self): """Check the number of operations and, if it above the minimum value, save the config file.""" - max_count = self._options['Network_Manager']['save_count'] + max_count = self._options['NetworkManager']['save_count'] _log.debug('Operations %d, max %d', self._operations, max_count) if self._operations > max_count: self._options.save() @@ -167,17 +167,17 @@ class Networks(object): conn.options(self._options) # add Networks own options - self._options.add_group('Network_Manager', 'Network Manager') + self._options.add_group('NetworkManager', 'Network Manager') self._options.add_option( '--timeout', - group='Network_Manager', + group='NetworkManager', option='timeout', help='Timeout for requests in all networks.', type='int', metavar='SECONDS', default=120) self._options.add_option( - group='Network_Manager', + group='NetworkManager', option='save_count', help='Number of network operations till the config file ' \ 'is saved', diff --git a/mitterlib/network/twitter.py b/mitterlib/network/twitter.py index a88dad2..f385005 100644 --- a/mitterlib/network/twitter.py +++ b/mitterlib/network/twitter.py @@ -252,7 +252,7 @@ class Connection(NetworkBase): _log.debug('Body: %s' % (body)) request.add_data(body) - timeout = self._options['Network_Manager']['timeout'] + timeout = self._options['NetworkManager']['timeout'] try: _log.debug('Starting request of %s (timeout %d)' % (url, timeout)) response = urllib2.urlopen(request, timeout=timeout) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 5b88c5c..4409c29 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -1274,7 +1274,7 @@ class Interface(object): def _download_pic(self, url): """Download a picture from the web. Can be used in a thread.""" request = urllib2.Request(url=url) - timeout = self._options['Network_Manager']['timeout'] + timeout = self._options['NetworkManager']['timeout'] _log.debug('Starting request of %s (timeout %d)' % (url, timeout)) response = urllib2.urlopen(request, timeout=timeout) data = response.read()