# HG changeset patch # User Sylvain Thénault # Date 1250148127 -7200 # Node ID 968108e16066cf9a6b76a1f806a5685e81421456 # Parent 39712da6f397f66b187c96d526fd9f1270e17166 move underline_title to toolsutils diff -r 39712da6f397 -r 968108e16066 __init__.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. diff -r 39712da6f397 -r 968108e16066 cwctl.py --- 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""" diff -r 39712da6f397 -r 968108e16066 devtools/devctl.py --- 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 diff -r 39712da6f397 -r 968108e16066 server/serverctl.py --- 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 diff -r 39712da6f397 -r 968108e16066 toolsutils.py --- 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): diff -r 39712da6f397 -r 968108e16066 web/webctl.py --- 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):