Commit 36bf9ff7 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

move underline_title to toolsutils

parent 39712da6f397
......@@ -314,9 +314,6 @@ def target(obj):
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.
......
......@@ -11,9 +11,10 @@ from os.path import exists, join, isfile, isdir
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"""
......
......@@ -20,12 +20,13 @@ from logilab.common.textutils import splitstrip
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
......
......@@ -14,8 +14,8 @@ from logilab.common.configuration import Configuration
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
......
......@@ -21,6 +21,9 @@ from logilab.common.shellutils import ASK
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):
......
......@@ -8,8 +8,7 @@ web configuration
"""
__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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment