Commit 4d6a2450 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[cwctl] refactor ui messages aiming for consistency and simplicity

--HG--
branch : stable
parent 04d0624a1832
......@@ -389,10 +389,9 @@ class CreateInstanceCommand(Command):
# write down configuration
config.save()
self._handle_win32(config, appid)
print '-> generated %s' % config.main_config_file()
print '-> generated config %s' % config.main_config_file()
# handle i18n files structure
# in the first cube given
print '-> preparing i18n catalogs'
from cubicweb import i18n
langs = [lang for lang, _ in i18n.available_catalogs(join(templdirs[0], 'i18n'))]
errors = config.i18ncompile(langs)
......@@ -412,7 +411,7 @@ class CreateInstanceCommand(Command):
# this directory should be owned by the uid of the server process
print 'set %s as owner of the data directory' % config['uid']
chown(config.appdatahome, config['uid'])
print '\n-> creation done for %r.\n' % config.apphome
print '\n-> creation done for %s\n' % repr(config.apphome)[1:-1]
helper.postcreate(self.config.automatic)
def _handle_win32(self, config, appid):
......
......@@ -80,7 +80,7 @@ def compile_i18n_catalogs(sourcedirs, destdir, langs):
"""generate .mo files for a set of languages into the `destdir` i18n directory
"""
from logilab.common.fileutils import ensure_fs_mode
print '-> compiling %s catalogs...' % destdir
print '-> compiling message catalogs to %s' % destdir
errors = []
for lang in langs:
langdir = join(destdir, lang, 'LC_MESSAGES')
......
......@@ -180,7 +180,7 @@ class RepositoryCreateHandler(CommandHandler):
if automatic:
# XXX modify a copy
password = generate_password()
print 'Administration account is admin / %s' % password
print '-> set administrator account to admin / %s' % password
USER_OPTIONS[1][1]['default'] = password
sconfig = Configuration(options=USER_OPTIONS)
else:
......
......@@ -58,12 +58,12 @@ def create_dir(directory):
"""create a directory if it doesn't exist yet"""
try:
makedirs(directory)
print '-> created directory %s.' % directory
print '-> created directory %s' % directory
except OSError, ex:
import errno
if ex.errno != errno.EEXIST:
raise
print '-> directory %s already exists, no need to create it.' % directory
print '-> no need to create existing directory %s' % directory
def create_symlink(source, target):
"""create a symbolic link"""
......@@ -154,9 +154,9 @@ def fill_templated_file(fpath, tfpath, context):
def restrict_perms_to_user(filepath, log=None):
"""set -rw------- permission on the given file"""
if log:
log('set %s permissions to 0600', filepath)
log('set permissions to 0600 for %s', filepath)
else:
print '-> set %s permissions to 0600' % filepath
print '-> set permissions to 0600 for %s' % filepath
chmod(filepath, 0600)
def read_config(config_file):
......
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