From 10f33da79d6c99d0360bd2c1d3365af4d7fc991c Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Fri, 26 Feb 2010 20:08:13 +0100 Subject: Rename class List to ListRemote, make ListRemote and ListLocal derive from a new class List --- layman/action.py | 22 ++++++++++++++++------ 1 file 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 -- cgit v1.2.3-1-g7c22