# HG changeset patch # User Aurélien Campéas # Date 1252338388 -7200 # Node ID 32686ae66c75700bfb2a45d02848420366eae1c5 # Parent 8bf500eb01d6365a4973606f7595a625ba4289b8 mostly adapt the i18n subsystem to limitation wrt redirection handinling in windows, using the -o argument of the utilities diff -r 8bf500eb01d6 -r 32686ae66c75 common/i18n.py --- a/common/i18n.py Mon Sep 07 12:23:42 2009 +0200 +++ b/common/i18n.py Mon Sep 07 17:46:28 2009 +0200 @@ -44,9 +44,10 @@ status != 0 """ print cmd.replace(os.getcwd() + os.sep, '') - status = os.system(cmd) + from subprocess import call + status = call(cmd) if status != 0: - raise Exception() + raise Exception('status = %s' % status) def available_catalogs(i18ndir=None): @@ -74,8 +75,8 @@ mergedpo = join(destdir, '%s_merged.po' % lang) try: # merge instance/cubes messages catalogs with the stdlib's one - execute('msgcat --use-first --sort-output --strict %s > %s' - % (' '.join(pofiles), mergedpo)) + execute('msgcat --use-first --sort-output --strict -o %s %s' + % (mergedpo, ' '.join('"%s"' % f for f in pofiles))) # make sure the .mo file is writeable and compile with *msgfmt* applmo = join(destdir, lang, 'LC_MESSAGES', 'cubicweb.mo') try: diff -r 8bf500eb01d6 -r 32686ae66c75 cwctl.py --- a/cwctl.py Mon Sep 07 12:23:42 2009 +0200 +++ b/cwctl.py Mon Sep 07 17:46:28 2009 +0200 @@ -29,7 +29,7 @@ while nbtry < maxtry: try: kill(pid, signal.SIGUSR1) - except OSError: + except (OSError, AttributeError): # XXX win32 break nbtry += 1 sleep(waittime) diff -r 8bf500eb01d6 -r 32686ae66c75 devtools/devctl.py --- a/devtools/devctl.py Mon Sep 07 12:23:42 2009 +0200 +++ b/devtools/devctl.py Mon Sep 07 17:46:28 2009 +0200 @@ -260,6 +260,7 @@ from logilab.common.shellutils import globfind, find, rm from cubicweb.common.i18n import extract_from_tal, execute tempdir = tempfile.mkdtemp() + assert exists(tempdir) potfiles = [join(I18NDIR, 'static-messages.pot')] print '-> extract schema messages.' schemapot = join(tempdir, 'schema.pot') @@ -283,22 +284,23 @@ if lang is not None: cmd += ' -L %s' % lang potfile = join(tempdir, '%s.pot' % id) - execute(cmd % (potfile, ' '.join(files))) + execute(cmd % (potfile, ' '.join('"%s"' % f for f in files))) if exists(potfile): potfiles.append(potfile) else: print '-> WARNING: %s file was not generated' % potfile print '-> merging %i .pot files' % len(potfiles) cubicwebpot = join(tempdir, 'cubicweb.pot') - execute('msgcat %s > %s' % (' '.join(potfiles), cubicwebpot)) + execute('msgcat -o %s %s' % (cubicwebpot, ' '.join('"%s"' % f for f in potfiles))) print '-> merging main pot file with existing translations.' chdir(I18NDIR) toedit = [] for lang in LANGS: target = '%s.po' % lang - execute('msgmerge -N --sort-output %s %s > %snew' % (target, cubicwebpot, target)) + execute('msgmerge -N --sort-output -o %snew %s %s' % (target, cubicwebpot, target)) ensure_fs_mode(target) shutil.move('%snew' % target, target) + assert exists(target) toedit.append(abspath(target)) # cleanup rm(tempdir) @@ -395,7 +397,8 @@ potfiles.append(tmppotfile) potfile = join(tempdir, 'cube.pot') print '-> merging %i .pot files:' % len(potfiles) - execute('msgcat %s > %s' % (' '.join(potfiles), potfile)) + execute('msgcat -o %s %s' % (potfile, + ' '.join('"%s"' % f for f in potfiles))) print '-> merging main pot file with existing translations:' chdir('i18n') for lang in LANGS: @@ -404,7 +407,7 @@ if not exists(cubepo): shutil.copy(potfile, cubepo) else: - execute('msgmerge -N -s %s %s > %snew' % (cubepo, potfile, cubepo)) + execute('msgmerge -N -s -o %snew %s %s' % (cubepo, potfile, cubepo)) ensure_fs_mode(cubepo) shutil.move('%snew' % cubepo, cubepo) toedit.append(abspath(cubepo)) diff -r 8bf500eb01d6 -r 32686ae66c75 etwist/server.py --- a/etwist/server.py Mon Sep 07 12:23:42 2009 +0200 +++ b/etwist/server.py Mon Sep 07 17:46:28 2009 +0200 @@ -15,11 +15,13 @@ from urlparse import urlsplit, urlunsplit import hotshot -from twisted.application import service, strports +from twisted.application import strports try: from twisted.scripts._twistd_unix import daemonize except ImportError: - pass + def daemonize(): + raise NotImplementedError('not yet for win32') + from twisted.internet import reactor, task, threads from twisted.internet.defer import maybeDeferred from twisted.web2 import channel, http, server, iweb