diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2010-02-26 20:08:13 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2010-02-26 20:32:48 +0100 |
commit | 10f33da79d6c99d0360bd2c1d3365af4d7fc991c (patch) | |
tree | 2f993c9733ea53b91b56f8fbef1a0293e258b55d | |
parent | pylint: Resolve redefinition of variable by renaming (diff) | |
download | layman-10f33da79d6c99d0360bd2c1d3365af4d7fc991c.tar.gz layman-10f33da79d6c99d0360bd2c1d3365af4d7fc991c.tar.bz2 layman-10f33da79d6c99d0360bd2c1d3365af4d7fc991c.zip |
Rename class List to ListRemote, make ListRemote and ListLocal derive from a new class List
-rw-r--r-- | layman/action.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/layman/action.py b/layman/action.py index cdd2dbf..c786d51 100644 --- a/layman/action.py +++ b/layman/action.py @@ -367,7 +367,17 @@ class Info: # #------------------------------------------------------------------------------- -class List: +class List(object): + def __init__(self, config): + self.config = config + +#=============================================================================== +# +# Class ListRemote +# +#------------------------------------------------------------------------------- + +class ListRemote(List): ''' Lists the available overlays. >>> import os @@ -383,7 +393,7 @@ class List: ... 'width':80, ... 'svn_command':'/usr/bin/svn', ... 'rsync_command':'/usr/bin/rsync'} - >>> a = List(config) + >>> a = ListRemote(config) >>> a.rdb.cache() >>> OUT.color_off() >>> a.run() @@ -421,7 +431,7 @@ class List: OUT.debug('Creating RemoteDB handler', 6) self.rdb = RemoteDB(config) - self.config = config + super(ListRemote, self).__init__(config) def run(self): ''' List the available overlays.''' @@ -458,12 +468,12 @@ class List: # #------------------------------------------------------------------------------- -class ListLocal: +class ListLocal(List): ''' Lists the local overlays.''' def __init__(self, config): self.db = DB(config) - self.config = config + super(ListLocal, self).__init__(config) def run(self): '''List the overlays.''' @@ -513,7 +523,7 @@ def main(config): ('info', Info), ('sync_all', Sync), ('delete', Delete), - ('list', List), + ('list', ListRemote), ('list_local', ListLocal),] if True: # A hack to save diff with indentation changes only |