get_csv is being renamed to splitstrip
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Sat, 01 Aug 2009 16:21:52 +0200
changeset 2633 bc9386c3b2c9
parent 2632 920bfaff60a4
child 2634 273eec072cf8
get_csv is being renamed to splitstrip
cwctl.py
devtools/devctl.py
server/__init__.py
server/serverconfig.py
server/sources/ldapuser.py
--- a/cwctl.py	Sat Aug 01 16:20:08 2009 +0200
+++ b/cwctl.py	Sat Aug 01 16:21:52 2009 +0200
@@ -265,9 +265,9 @@
 
     def run(self, args):
         """run the command with its specific arguments"""
-        from logilab.common.textutils import get_csv
+        from logilab.common.textutils import splitstrip
         configname = self.config.config
-        cubes = get_csv(pop_arg(args, 1))
+        cubes = splitstrip(pop_arg(args, 1))
         appid = pop_arg(args)
         # get the configuration and helper
         cwcfg.creating = True
--- a/devtools/devctl.py	Sat Aug 01 16:20:08 2009 +0200
+++ b/devtools/devctl.py	Sat Aug 01 16:21:52 2009 +0200
@@ -16,7 +16,7 @@
 
 from logilab.common import STD_BLACKLIST
 from logilab.common.modutils import get_module_files
-from logilab.common.textutils import get_csv
+from logilab.common.textutils import splitstrip
 from logilab.common.shellutils import ASK
 from logilab.common.clcommands import register_commands
 
@@ -535,7 +535,7 @@
             if answer == 'y':
                 includes.append(stdtype)
             if answer == 'type':
-                includes = get_csv(raw_input('type dependancies: '))
+                includes = splitstrip(raw_input('type dependancies: '))
                 break
             elif answer == 'skip':
                 break
--- a/server/__init__.py	Sat Aug 01 16:20:08 2009 +0200
+++ b/server/__init__.py	Sat Aug 01 16:21:52 2009 +0200
@@ -14,7 +14,7 @@
 from os.path import join, exists
 
 from logilab.common.modutils import LazyObject
-from logilab.common.textutils import get_csv
+from logilab.common.textutils import splitstrip
 
 # server-side debugging #########################################################
 
@@ -35,7 +35,7 @@
         DEBUG = 0
         return
     if isinstance(debugmode, basestring):
-        for mode in get_csv(debugmode, sep='|'):
+        for mode in splitstrip(debugmode, sep='|'):
             DEBUG |= globals()[mode]
     else:
         DEBUG |= debugmode
--- a/server/serverconfig.py	Sat Aug 01 16:20:08 2009 +0200
+++ b/server/serverconfig.py	Sat Aug 01 16:21:52 2009 +0200
@@ -212,12 +212,12 @@
         return env_path('CW_SCHEMA_LIB', cls.SCHEMAS_LIB_DIR, 'schemas')
 
     def bootstrap_cubes(self):
-        from logilab.common.textutils import get_csv
+        from logilab.common.textutils import splitstrip
         for line in file(join(self.apphome, 'bootstrap_cubes')):
             line = line.strip()
             if not line or line.startswith('#'):
                 continue
-            self.init_cubes(self.expand_cubes(get_csv(line)))
+            self.init_cubes(self.expand_cubes(splitstrip(line)))
             break
         else:
             # no cubes
--- a/server/sources/ldapuser.py	Sat Aug 01 16:20:08 2009 +0200
+++ b/server/sources/ldapuser.py	Sat Aug 01 16:21:52 2009 +0200
@@ -23,7 +23,7 @@
 
 from base64 import b64decode
 
-from logilab.common.textutils import get_csv
+from logilab.common.textutils import splitstrip
 from rql.nodes import Relation, VariableRef, Constant, Function
 
 import ldap
@@ -131,10 +131,10 @@
         self.host = source_config['host']
         self.user_base_dn = source_config['user-base-dn']
         self.user_base_scope = globals()[source_config['user-scope']]
-        self.user_classes = get_csv(source_config['user-classes'])
+        self.user_classes = splitstrip(source_config['user-classes'])
         self.user_login_attr = source_config['user-login-attr']
-        self.user_default_groups = get_csv(source_config['user-default-group'])
-        self.user_attrs = dict(v.split(':', 1) for v in get_csv(source_config['user-attrs-map']))
+        self.user_default_groups = splitstrip(source_config['user-default-group'])
+        self.user_attrs = dict(v.split(':', 1) for v in splitstrip(source_config['user-attrs-map']))
         self.user_rev_attrs = {'eid': 'dn'}
         for ldapattr, cwattr in self.user_attrs.items():
             self.user_rev_attrs[cwattr] = ldapattr