diff options
author | 2015-07-10 09:46:49 -0400 | |
---|---|---|
committer | 2015-07-10 09:46:53 -0400 | |
commit | b32d76e2e155d2298555c9a2941517bc007ea55b (patch) | |
tree | bca14254a25cb7478e4a936ae2f192b1f3dd5c21 | |
parent | api.py: Removes annoying lack of space in error message (diff) | |
download | layman-b32d76e2e155d2298555c9a2941517bc007ea55b.tar.gz layman-b32d76e2e155d2298555c9a2941517bc007ea55b.tar.bz2 layman-b32d76e2e155d2298555c9a2941517bc007ea55b.zip |
Renames db module "xml" to "xml_db"
This prevents namespace collisions with the required xml class.
-rw-r--r-- | etc/layman.cfg | 2 | ||||
-rw-r--r-- | layman/config.py | 2 | ||||
-rw-r--r-- | layman/db_modules/xml_db/__init__.py (renamed from layman/db_modules/xml/__init__.py) | 4 | ||||
-rw-r--r-- | layman/db_modules/xml_db/xml_db.py (renamed from layman/db_modules/xml/xml.py) | 4 | ||||
-rwxr-xr-x | layman/tests/external.py | 10 |
5 files changed, 11 insertions, 11 deletions
diff --git a/etc/layman.cfg b/etc/layman.cfg index 76f5f46..45fe3fc 100644 --- a/etc/layman.cfg +++ b/etc/layman.cfg @@ -69,7 +69,7 @@ conf_type : repos.conf #----------------------------------------------------------- # Database types used by layman # For now, only xml. -#db_type : xml +#db_type : xml_db #----------------------------------------------------------- diff --git a/layman/config.py b/layman/config.py index 853e22f..0ad975b 100644 --- a/layman/config.py +++ b/layman/config.py @@ -100,7 +100,7 @@ class BareConfig(object): 'auto_sync': 'No', 'check_official': 'Yes', 'conf_type': 'repos.conf', - 'db_type': 'xml', + 'db_type': 'xml_db', 'require_repoconfig': 'Yes', 'clean_archive': 'yes', 'make_conf' : '%(storage)s/make.conf', diff --git a/layman/db_modules/xml/__init__.py b/layman/db_modules/xml_db/__init__.py index 96861d7..ad6506c 100644 --- a/layman/db_modules/xml/__init__.py +++ b/layman/db_modules/xml_db/__init__.py @@ -6,11 +6,11 @@ XML database plug-in module for layman. ''' module_spec = { - 'name': 'xml', + 'name': 'xml_db', 'description': __doc__, 'provides':{ 'xml-module': { - 'name': 'xml', + 'name': 'xml_db', 'class': 'DBHandler', 'description': __doc__, 'functions': ['add_new', 'read_db', 'write'], diff --git a/layman/db_modules/xml/xml.py b/layman/db_modules/xml_db/xml_db.py index c444fc3..6348162 100644 --- a/layman/db_modules/xml/xml.py +++ b/layman/db_modules/xml_db/xml_db.py @@ -3,7 +3,7 @@ ################################################################################# # LAYMAN XML DB ################################################################################# -# File: xml.py +# File: xml_db.py # # Access XML overlay database(s). # @@ -18,7 +18,7 @@ from __future__ import unicode_literals -__version__ = "$Id: xml.py 273 2015-07-07 10:30:30Z twitch153 $" +__version__ = "$Id: xml_db.py 273 2015-07-07 10:30:30Z twitch153 $" #=============================================================================== # diff --git a/layman/tests/external.py b/layman/tests/external.py index e2a44b0..0dad278 100755 --- a/layman/tests/external.py +++ b/layman/tests/external.py @@ -637,7 +637,7 @@ class ReadWriteSelectListDbBase(unittest.TestCase): output = Message() config = { 'output': output, - 'db_type': 'xml', + 'db_type': 'xml_db', 'svn_command': '/usr/bin/svn', 'rsync_command':'/usr/bin/rsync' } @@ -672,7 +672,7 @@ class ReadWriteSelectListDbBase(unittest.TestCase): def read_db(self): output = Message() config = {'output': output, - 'db_type': 'xml',} + 'db_type': 'xml_db',} db = DbBase(config, [HERE + '/testfiles/global-overlays.xml', ]) keys = sorted(db.overlays) self.assertEqual(keys, ['wrobel', 'wrobel-stable']) @@ -684,7 +684,7 @@ class ReadWriteSelectListDbBase(unittest.TestCase): def select_db(self): output = Message() config = {'output': output, - 'db_type': 'xml',} + 'db_type': 'xml_db',} db = DbBase(config, [HERE + '/testfiles/global-overlays.xml', ]) url = ['rsync://gunnarwrobel.de/wrobel-stable'] self.assertEqual(list(db.select('wrobel-stable').source_uris()), url) @@ -696,12 +696,12 @@ class ReadWriteSelectListDbBase(unittest.TestCase): config = BareConfig() a = DbBase(config, [HERE + '/testfiles/global-overlays.xml', ]) - b = DbBase({'output': Message(), 'db_type': 'xml'}, [test_xml,]) + b = DbBase({'output': Message(), 'db_type': 'xml_db'}, [test_xml,]) b.overlays['wrobel-stable'] = a.overlays['wrobel-stable'] b.write(test_xml) - c = DbBase({'output': Message(), 'db_type': 'xml'}, [test_xml,]) + c = DbBase({'output': Message(), 'db_type': 'xml_db'}, [test_xml,]) keys = sorted(c.overlays) self.assertEqual(keys, ['wrobel-stable']) |