From 15b8a5bbdf3fb81edc6eac707bd2bd78d54394cf Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Sun, 20 Sep 2009 11:08:30 +0000 Subject: Update syntax of calls to print() for compatibility with Python 3. (2to3-3.1 -f print -nw ${FILES}) svn path=/main/trunk/; revision=14290 --- bin/dispatch-conf | 55 +++++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) (limited to 'bin/dispatch-conf') diff --git a/bin/dispatch-conf b/bin/dispatch-conf index d0309701e..2ef55a908 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -104,9 +104,8 @@ class dispatch: if self.options['use-rcs'] == 'yes': for rcs_util in ("rcs", "ci", "co", "rcsmerge"): if not find_binary(rcs_util): - print >> sys.stderr, \ - 'dispatch-conf: Error finding all RCS utils and " + \ - "use-rcs=yes in config; fatal' + print('dispatch-conf: Error finding all RCS utils and " + \ + "use-rcs=yes in config; fatal', file=sys.stderr) return False @@ -225,9 +224,9 @@ class dispatch: cmd = self.options['diff'] % (conf['current'], newconf) spawn_shell(cmd) - print - print '>> (%i of %i) -- %s' % (count, len(confs), conf ['current']) - print '>> q quit, h help, n next, e edit-new, z zap-new, u use-new\n m merge, t toggle-merge, l look-merge: ', + print() + print('>> (%i of %i) -- %s' % (count, len(confs), conf ['current'])) + print('>> q quit, h help, n next, e edit-new, z zap-new, u use-new\n m merge, t toggle-merge, l look-merge: ', end=' ') # In some cases getch() will return some spurious characters # that do not represent valid input. If we don't validate the @@ -255,10 +254,10 @@ class dispatch: break elif c == 'm': merged = SCRATCH_DIR+"/"+os.path.basename(conf['current']) - print + print() ret = os.system (self.options['merge'] % (merged, conf ['current'], newconf)) if ret: - print "Failure running 'merge' command" + print("Failure running 'merge' command") continue shutil.copyfile(merged, mrgconf) os.remove(merged) @@ -292,12 +291,12 @@ class dispatch: raise AssertionError("Invalid Input: %s" % c) if auto_zapped: - print - print " One or more updates are frozen and have been automatically zapped:" - print + print() + print(" One or more updates are frozen and have been automatically zapped:") + print() for frozen in auto_zapped: - print " * '%s'" % frozen - print + print(" * '%s'" % frozen) + print() def replace (self, newconf, curconf): """Replace current config with the new/merged version. Also logs @@ -306,8 +305,8 @@ class dispatch: try: os.rename(newconf, curconf) except (IOError, os.error) as why: - print >> sys.stderr, 'dispatch-conf: Error renaming %s to %s: %s; fatal' % \ - (newconf, curconf, str(why)) + print('dispatch-conf: Error renaming %s to %s: %s; fatal' % \ + (newconf, curconf, str(why)), file=sys.stderr) def post_process(self, curconf): @@ -354,19 +353,19 @@ class dispatch: def do_help (self): - print; print - - print ' u -- update current config with new config and continue' - print ' z -- zap (delete) new config and continue' - print ' n -- skip to next config, leave all intact' - print ' e -- edit new config' - print ' m -- interactively merge current and new configs' - print ' l -- look at diff between pre-merged and merged configs' - print ' t -- toggle new config between merged and pre-merged state' - print ' h -- this screen' - print ' q -- quit' - - print; print 'press any key to return to diff...', + print(); print + + print(' u -- update current config with new config and continue') + print(' z -- zap (delete) new config and continue') + print(' n -- skip to next config, leave all intact') + print(' e -- edit new config') + print(' m -- interactively merge current and new configs') + print(' l -- look at diff between pre-merged and merged configs') + print(' t -- toggle new config between merged and pre-merged state') + print(' h -- this screen') + print(' q -- quit') + + print(); print('press any key to return to diff...', end=' ') getch () -- cgit v1.2.3-1-g7c22