summaryrefslogtreecommitdiffstats
path: root/Tools/pynche/Switchboard.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-04-26 23:17:16 (GMT)
committerBarry Warsaw <barry@python.org>1999-04-26 23:17:16 (GMT)
commit0604d723183bee9ca18920708ec7fd44fbc4c63b (patch)
treefdffddafc755782e374fe2b7a2efb0ea6443547f /Tools/pynche/Switchboard.py
parent0ec1493d0b0bdbef561c819c560a6703256c88a1 (diff)
downloadcpython-0604d723183bee9ca18920708ec7fd44fbc4c63b.zip
cpython-0604d723183bee9ca18920708ec7fd44fbc4c63b.tar.gz
cpython-0604d723183bee9ca18920708ec7fd44fbc4c63b.tar.bz2
Lots of changes to support loading alternative color name database.
You can switch database by just loading the new one; the list window and nearest colors adapt to the new database. Some reorganizing of code. Also, the name of the database file is stored in the ~/.pynche pickle. If it can't be loaded, fallbacks are used.
Diffstat (limited to 'Tools/pynche/Switchboard.py')
-rw-r--r--Tools/pynche/Switchboard.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Tools/pynche/Switchboard.py b/Tools/pynche/Switchboard.py
index 3b06f11..9f2c64c 100644
--- a/Tools/pynche/Switchboard.py
+++ b/Tools/pynche/Switchboard.py
@@ -17,9 +17,9 @@ from types import DictType
import marshal
class Switchboard:
- def __init__(self, colordb, initfile):
+ def __init__(self, initfile):
self.__initfile = initfile
- self.__colordb = colordb
+ self.__colordb = None
self.__optiondb = {}
self.__views = []
self.__red = 0
@@ -63,6 +63,9 @@ class Switchboard:
def colordb(self):
return self.__colordb
+ def set_colordb(self, colordb):
+ self.__colordb = colordb
+
def optiondb(self):
return self.__optiondb
@@ -74,6 +77,9 @@ class Switchboard:
for v in self.__views:
if hasattr(v, 'save_options'):
v.save_options(self.__optiondb)
+ # save the name of the file used for the color database. we'll try to
+ # load this first.
+ self.__optiondb['DBFILE'] = self.__colordb.filename()
fp = None
try:
try: