move underline_title to toolsutils
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 13 Aug 2009 09:22:07 +0200
changeset 2790 968108e16066
parent 2789 39712da6f397
child 2791 7ef2b08fbe28
move underline_title to toolsutils
__init__.py
cwctl.py
devtools/devctl.py
server/serverctl.py
toolsutils.py
web/webctl.py
--- a/__init__.py	Wed Aug 12 19:09:32 2009 +0200
+++ b/__init__.py	Thu Aug 13 09:22:07 2009 +0200
@@ -314,9 +314,6 @@
     except AttributeError:
         return neg_role(obj.role)
 
-def underline_title(title, car='-'):
-    return title+'\n'+(car*len(title))
-
 
 class CubicWebEventManager(object):
     """simple event / callback manager.
--- a/cwctl.py	Wed Aug 12 19:09:32 2009 +0200
+++ b/cwctl.py	Thu Aug 13 09:22:07 2009 +0200
@@ -11,9 +11,10 @@
 from logilab.common.clcommands import register_commands, pop_arg
 from logilab.common.shellutils import ASK
 
-from cubicweb import ConfigurationError, ExecutionError, BadCommandUsage, underline_title
+from cubicweb import ConfigurationError, ExecutionError, BadCommandUsage
 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CONFIGURATIONS
-from cubicweb.toolsutils import Command, main_run,  rm, create_dir
+from cubicweb.toolsutils import Command, main_run, rm, create_dir, underline_title
+
 
 def wait_process_end(pid, maxtry=10, waittime=1):
     """wait for a process to actually die"""
--- a/devtools/devctl.py	Wed Aug 12 19:09:32 2009 +0200
+++ b/devtools/devctl.py	Thu Aug 13 09:22:07 2009 +0200
@@ -20,12 +20,13 @@
 from logilab.common.shellutils import ASK
 from logilab.common.clcommands import register_commands
 
-from cubicweb import CW_SOFTWARE_ROOT as BASEDIR, BadCommandUsage, underline_title
+from cubicweb import CW_SOFTWARE_ROOT as BASEDIR, BadCommandUsage
 from cubicweb.__pkginfo__ import version as cubicwebversion
-from cubicweb.toolsutils import Command, copy_skeleton
+from cubicweb.toolsutils import Command, copy_skeleton, underline_title
 from cubicweb.web.webconfig import WebConfiguration
 from cubicweb.server.serverconfig import ServerConfiguration
 
+
 class DevCubeConfiguration(ServerConfiguration, WebConfiguration):
     """dummy config to get full library schema and entities"""
     creating = True
--- a/server/serverctl.py	Wed Aug 12 19:09:32 2009 +0200
+++ b/server/serverctl.py	Thu Aug 13 09:22:07 2009 +0200
@@ -14,8 +14,8 @@
 from logilab.common.clcommands import register_commands, cmd_run, pop_arg
 from logilab.common.shellutils import ASK
 
-from cubicweb import AuthenticationError, ExecutionError, ConfigurationError, underline_title
-from cubicweb.toolsutils import Command, CommandHandler
+from cubicweb import AuthenticationError, ExecutionError, ConfigurationError
+from cubicweb.toolsutils import Command, CommandHandler, underline_title
 from cubicweb.server import SOURCE_TYPES
 from cubicweb.server.utils import ask_source_config
 from cubicweb.server.serverconfig import USER_OPTIONS, ServerConfiguration
--- a/toolsutils.py	Wed Aug 12 19:09:32 2009 +0200
+++ b/toolsutils.py	Thu Aug 13 09:22:07 2009 +0200
@@ -21,6 +21,9 @@
 from cubicweb import warning
 from cubicweb import ConfigurationError, ExecutionError
 
+def underline_title(title, car='-'):
+    return title+'\n'+(car*len(title))
+
 def iter_dir(directory, condition_file=None, ignore=()):
     """iterate on a directory"""
     for sub in listdir(directory):
--- a/web/webctl.py	Wed Aug 12 19:09:32 2009 +0200
+++ b/web/webctl.py	Thu Aug 13 09:22:07 2009 +0200
@@ -8,8 +8,7 @@
 """
 __docformat__ = "restructuredtext en"
 
-from cubicweb import underline_title
-from cubicweb.toolsutils import CommandHandler
+from cubicweb.toolsutils import CommandHandler, underline_title
 from logilab.common.shellutils import ASK
 
 class WebCreateHandler(CommandHandler):