diff options
-rw-r--r-- | layman/db.py | 16 | ||||
-rw-r--r-- | layman/dbbase.py (renamed from layman/overlay.py) | 16 | ||||
-rw-r--r-- | layman/tests/dtest.py | 4 | ||||
-rw-r--r-- | layman/tests/external.py | 8 |
4 files changed, 22 insertions, 22 deletions
diff --git a/layman/db.py b/layman/db.py index e0763b3..ceb89f1 100644 --- a/layman/db.py +++ b/layman/db.py @@ -27,7 +27,7 @@ __version__ = "$Id: db.py 309 2007-04-09 16:23:38Z wrobel $" import os, codecs, os.path, urllib2, re, hashlib from layman.utils import path, delete_empty_directory -from layman.overlay import Overlays, UnknownOverlayException +from layman.dbbase import DbBase, UnknownOverlayException from layman.debug import OUT @@ -37,7 +37,7 @@ from layman.debug import OUT # #------------------------------------------------------------------------------- -class DB(Overlays): +class DB(DbBase): ''' Handle the list of local overlays.''' def __init__(self, config): @@ -53,7 +53,7 @@ class DB(Overlays): quiet = int(config['quietness']) < 3 - Overlays.__init__(self, + DbBase.__init__(self, [config['local_list'], ], config, ignore, @@ -90,7 +90,7 @@ class DB(Overlays): # >>> b.add(a.select('wrobel-stable')) #doctest: +ELLIPSIS # * Running command "/usr/bin/rsync -rlptDvz --progress --delete --delete-after --timeout=180 --exclude="distfiles/*" --exclude="local/*" --exclude="packages/*" "rsync://gunnarwrobel.de/wrobel-stable/*" "/tmp/file.../wrobel-stable""... - # >>> c = Overlays([write, ], dict()) + # >>> c = DbBase([write, ], dict()) # >>> c.overlays.keys() # [u'wrobel-stable'] @@ -162,12 +162,12 @@ class DB(Overlays): # * Running command "/usr/bin/rsync -rlptDvz --progress --delete --delete-after --timeout=180 --exclude="distfiles/*" --exclude="local/*" --exclude="packages/*" "rsync://gunnarwrobel.de/wrobel-stable/*" "/tmp/file.../wrobel-stable""... # >>> b.add(a.select('wrobel')) #doctest: +ELLIPSIS # * Running command "/usr/bin/svn co "https://overlays.gentoo.org/svn/dev/wrobel/" "/tmp/file.../wrobel""... - # >>> c = Overlays([write, ], dict()) + # >>> c = DbBase([write, ], dict()) # >>> c.overlays.keys() # [u'wrobel', u'wrobel-stable'] # >>> b.delete(b.select('wrobel')) - # >>> c = Overlays([write, ], dict()) + # >>> c = DbBase([write, ], dict()) # >>> c.overlays.keys() # [u'wrobel-stable'] @@ -206,7 +206,7 @@ class DB(Overlays): # #------------------------------------------------------------------------------- -class RemoteDB(Overlays): +class RemoteDB(DbBase): '''Handles fetching the remote overlay list.''' def __init__(self, config): @@ -236,7 +236,7 @@ class RemoteDB(Overlays): quiet = int(config['quietness']) < 3 - Overlays.__init__(self, paths, config, ignore, quiet) + DbBase.__init__(self, paths, config, ignore, quiet) def cache(self): ''' diff --git a/layman/overlay.py b/layman/dbbase.py index 21bbc70..c5cd8a5 100644 --- a/layman/overlay.py +++ b/layman/dbbase.py @@ -49,11 +49,11 @@ class UnknownOverlayException(Exception): #=============================================================================== # -# Class Overlays +# Class DbBase # #------------------------------------------------------------------------------- -class Overlays: +class DbBase: ''' Handle a list of overlays.''' def __init__(self, paths, config, ignore = 0, quiet = False): @@ -98,7 +98,7 @@ class Overlays: >>> here = os.path.dirname(os.path.realpath(__file__)) >>> config = {'svn_command': '/usr/bin/svn', 'rsync_command':'/usr/bin/rsync'} - >>> a = Overlays([here + '/tests/testfiles/global-overlays.xml', ], config) + >>> a = DbBase([here + '/tests/testfiles/global-overlays.xml', ], config) >>> a.overlays.keys() [u'wrobel', u'wrobel-stable'] @@ -125,11 +125,11 @@ class Overlays: >>> write = os.tmpnam() >>> here = os.path.dirname(os.path.realpath(__file__)) >>> config = {'svn_command': '/usr/bin/svn', 'rsync_command':'/usr/bin/rsync'} - >>> a = Overlays([here + '/tests/testfiles/global-overlays.xml', ], config) - >>> b = Overlays([write,], dict()) + >>> a = DbBase([here + '/tests/testfiles/global-overlays.xml', ], config) + >>> b = DbBase([write,], dict()) >>> b.overlays['wrobel-stable'] = a.overlays['wrobel-stable'] >>> b.write(write) - >>> c = Overlays([write,], dict()) + >>> c = DbBase([write,], dict()) >>> c.overlays.keys() [u'wrobel-stable'] @@ -157,7 +157,7 @@ class Overlays: >>> here = os.path.dirname(os.path.realpath(__file__)) >>> config = {'svn_command': '/usr/bin/svn', 'rsync_command':'/usr/bin/rsync'} - >>> a = Overlays([here + '/tests/testfiles/global-overlays.xml', ], config) + >>> a = DbBase([here + '/tests/testfiles/global-overlays.xml', ], config) >>> list(a.select('wrobel-stable').source_uris()) [u'rsync://gunnarwrobel.de/wrobel-stable'] ''' @@ -171,7 +171,7 @@ class Overlays: >>> here = os.path.dirname(os.path.realpath(__file__)) >>> config = {'svn_command': '/usr/bin/svn', 'rsync_command':'/usr/bin/rsync'} - >>> a = Overlays([here + '/tests/testfiles/global-overlays.xml', ], config) + >>> a = DbBase([here + '/tests/testfiles/global-overlays.xml', ], config) >>> for i in a.list(True): ... print i[0] wrobel diff --git a/layman/tests/dtest.py b/layman/tests/dtest.py index ed5cac1..2f5ce77 100644 --- a/layman/tests/dtest.py +++ b/layman/tests/dtest.py @@ -52,7 +52,7 @@ import unittest, doctest, sys import layman.action #CT import layman.config #CT import layman.db #CT -import layman.overlay #CT +import layman.dbbase #CT import layman.utils #CT import layman.overlays.overlay #CT import layman.overlays.tar #CT @@ -68,7 +68,7 @@ def test_suite(): doctest.DocTestSuite(layman.action), doctest.DocTestSuite(layman.config), doctest.DocTestSuite(layman.db), - doctest.DocTestSuite(layman.overlay), + doctest.DocTestSuite(layman.dbbase), doctest.DocTestSuite(layman.utils), doctest.DocTestSuite(layman.overlays.overlay), doctest.DocTestSuite(layman.overlays.tar), diff --git a/layman/tests/external.py b/layman/tests/external.py index 9b336ee..28654ff 100644 --- a/layman/tests/external.py +++ b/layman/tests/external.py @@ -17,7 +17,7 @@ import unittest import os -from layman.overlay import Overlays +from layman.dbbase import DbBase from warnings import filterwarnings, resetwarnings HERE = os.path.dirname(os.path.realpath(__file__)) @@ -27,7 +27,7 @@ class Unicode(unittest.TestCase): def _overlays_bug(self, number): config = {} filename = os.path.join(HERE, 'testfiles', 'overlays_bug_%d.xml' % number) - o = Overlays([filename], config) + o = DbBase([filename], config) for verbose in (True, False): for t in o.list(verbose=verbose): print t[0] @@ -47,10 +47,10 @@ class FormatSubpathCategory(unittest.TestCase): 'subpath-%d.xml' % number) # Read, write, re-read, compare - os1 = Overlays([filename1], config) + os1 = DbBase([filename1], config) filename2 = os.tmpnam() os1.write(filename2) - os2 = Overlays([filename2], config) + os2 = DbBase([filename2], config) os.unlink(filename2) self.assertTrue(os1 == os2) |