]> git.decadent.org.uk Git - dak.git/commitdiff
move split_uploaders function to daklib.textutils
authorAnsgar Burchardt <ansgar@debian.org>
Mon, 27 Aug 2012 21:08:12 +0000 (23:08 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Mon, 27 Aug 2012 21:08:12 +0000 (23:08 +0200)
This allows the test suite to test split_uploaders again.

daklib/archive.py
daklib/textutils.py
tests/test_split_uploaders.py

index 08f59883d06705c15507dde26c359c17c66a31aa..aeca0a006e2a9b33a0db2e002443501ee6560212 100644 (file)
@@ -361,11 +361,7 @@ class ArchiveTransaction(object):
         # Uploaders are the maintainer and co-maintainers from the Uploaders field
         db_source.uploaders.append(maintainer)
         if 'Uploaders' in control:
-            def split_uploaders(field):
-                import re
-                for u in re.sub(">[ ]*,", ">\t", field).split("\t"):
-                    yield u.strip()
-
+            from daklib.textutils import split_uploaders
             for u in split_uploaders(control['Uploaders']):
                 db_source.uploaders.append(get_or_set_maintainer(u, session))
         session.flush()
index c9cc4ed380e7a6885b109b154b45893d5c046acc..b4646759a81b77dae865bc5e950c727e15778b18 100644 (file)
@@ -113,3 +113,8 @@ def fix_maintainer(maintainer):
     return (rfc822_maint, rfc2047_maint, name, email)
 
 ################################################################################
+
+def split_uploaders(field):
+    import re
+    for u in re.sub(">[ ]*,", ">\t", field).split("\t"):
+        yield u.strip()
index fe6bd91e984d4224a0cfcb37c2d5eca462c9f7cd..51812da03918b650bb57222cfe7b2b90612e5834 100755 (executable)
@@ -2,7 +2,7 @@
 
 from base_test import DakTestCase
 
-from daklib.dbconn import split_uploaders
+from daklib.textutils import split_uploaders
 
 import unittest