commit:     b32d76e2e155d2298555c9a2941517bc007ea55b
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 10 13:46:49 2015 +0000
Commit:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Fri Jul 10 13:46:53 2015 +0000
URL:        https://gitweb.gentoo.org/proj/layman.git/commit/?id=b32d76e2

Renames db module "xml" to "xml_db"

This prevents namespace collisions with the required xml class.

 etc/layman.cfg                                     |  2 +-
 layman/config.py                                   |  2 +-
 layman/db_modules/{xml => xml_db}/__init__.py      |  4 ++--
 layman/db_modules/{xml/xml.py => xml_db/xml_db.py} |  4 ++--
 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
similarity index 92%
rename from layman/db_modules/xml/__init__.py
rename to 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
similarity index 98%
rename from layman/db_modules/xml/xml.py
rename to 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'])
 

Reply via email to