[cwctl] refactor ui messages aiming for consistency and simplicity stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 31 Mar 2011 17:12:27 +0200
branchstable
changeset 7155 4bab50b02927
parent 7151 04d0624a1832
child 7156 b1521f1546e0
child 7157 7469fd77f48f
[cwctl] refactor ui messages aiming for consistency and simplicity
cwctl.py
i18n.py
server/serverctl.py
toolsutils.py
--- a/cwctl.py	Thu Mar 31 15:18:21 2011 +0200
+++ b/cwctl.py	Thu Mar 31 17:12:27 2011 +0200
@@ -389,10 +389,9 @@
         # 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 @@
             # 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):
--- a/i18n.py	Thu Mar 31 15:18:21 2011 +0200
+++ b/i18n.py	Thu Mar 31 17:12:27 2011 +0200
@@ -80,7 +80,7 @@
     """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')
--- a/server/serverctl.py	Thu Mar 31 15:18:21 2011 +0200
+++ b/server/serverctl.py	Thu Mar 31 17:12:27 2011 +0200
@@ -180,7 +180,7 @@
         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:
--- a/toolsutils.py	Thu Mar 31 15:18:21 2011 +0200
+++ b/toolsutils.py	Thu Mar 31 17:12:27 2011 +0200
@@ -58,12 +58,12 @@
     """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 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):