Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e3ca02a2
Commit
e3ca02a2
authored
Oct 22, 1998
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error message goes to stderr
canceled() takes an optional flag so that the canceled flag can be cleared.
parent
57610ff2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Tools/pynche/Switchboard.py
Tools/pynche/Switchboard.py
+8
-4
No files found.
Tools/pynche/Switchboard.py
View file @
e3ca02a2
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment