diff options
author | Barry Warsaw <barry@python.org> | 1998-10-22 18:48:01 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1998-10-22 18:48:01 (GMT) |
commit | 4ab5ae2ad02a5cbac5a285edab3fe47ea0e409fa (patch) | |
tree | 603d52b2a7a2472be4eb88c86bf498bf483fc911 /Tools | |
parent | d9e5214c2682dd5ea7bc86366549608f926b1365 (diff) | |
download | cpython-4ab5ae2ad02a5cbac5a285edab3fe47ea0e409fa.zip cpython-4ab5ae2ad02a5cbac5a285edab3fe47ea0e409fa.tar.gz cpython-4ab5ae2ad02a5cbac5a285edab3fe47ea0e409fa.tar.bz2 |
Error message goes to stderr
canceled() takes an optional flag so that the canceled flag can be
cleared.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/pynche/Switchboard.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Tools/pynche/Switchboard.py b/Tools/pynche/Switchboard.py index d8fd14c..3b06f11 100644 --- a/Tools/pynche/Switchboard.py +++ b/Tools/pynche/Switchboard.py @@ -12,6 +12,7 @@ conform to the following interface: since this would cause it to get updated twice. """ +import sys from types import DictType import marshal @@ -33,7 +34,9 @@ class Switchboard: fp = open(initfile) self.__optiondb = marshal.load(fp) if type(self.__optiondb) <> DictType: - print 'Problem reading options from file:', initfile + sys.stderr.write( + 'Problem reading options from file: %s\n' % + initfile) self.__optiondb = {} except (IOError, EOFError): pass @@ -76,7 +79,8 @@ class Switchboard: try: fp = open(self.__initfile, 'w') except IOError: - print 'Cannot write options to file:', file + sys.stderr.write('Cannot write options to file: %s\n' % + self.__initfile) else: marshal.dump(self.__optiondb, fp) finally: @@ -88,8 +92,8 @@ class Switchboard: if hasattr(v, 'withdraw'): v.withdraw() - def canceled(self): - self.__canceled = 1 + def canceled(self, flag=1): + self.__canceled = flag def canceled_p(self): return self.__canceled |