Make BaseScheme logger name determined by self.scheme_name, remove unneeded __init__ rewrite in local, and change Hive.init to match current documentation
1 # Copyright 2007 Sam Hart
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 The Swarm Hive "super" class
22 This class houses the most common Swarm Hive interactions.
28 def __init__(self, url, log, Force=False, config=None):
30 Basic URL parsing wrapper class
32 .scheme = The scheme in use
33 .netloc = The network location
35 .params = Parameters for path element
36 .query = Query component
37 .fragment = fragment identifier
38 .username = username to use (if authentication is needed)
39 .password = password to use (if authentication is needed)
44 self._parsed = urlparse(url)
45 self.scheme = self._parsed.scheme.lower()
46 self.netloc = self._parsed.netloc
47 self.path = self._parsed.path
48 self.params = self._parsed.params
49 self.query = self._parsed.query
50 self.fragment = self._parsed.fragment
51 self.username = self._parsed.username
52 self.password = self._parsed.password
53 self.hostname = self._parsed.hostname
54 self.port = self._parsed.port
55 self.connected = False
56 self.connection = None
58 self._alt_config_file = config
61 self._logger = log.get_logger("Hive")
63 def init_hive(self, force=False, ):
65 Called when a new Hive is to be initialized
72 Returns nothing on success, otherwise raises an exception.
75 self.connection = connect.get_connection(self._parsed, self._log,
80 self.config = self.connection.get_config()