From 965adc7b2760747368ae05236ad07fcc9f2e56ef Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Tue, 9 Feb 2010 18:51:37 -0500 Subject: [PATCH] Add EXEC_PATH to constants. --- pyfpdb/Configuration.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index ec4c621e..c3c93293 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -166,6 +166,10 @@ if LOCALE_ENCODING == "US-ASCII": # needs LOCALE_ENCODING (above), imported for sqlite setup in Config class below + +FROZEN = hasattr(sys, "frozen") +EXEC_PATH = get_exec_path() + import Charset @@ -613,7 +617,11 @@ class Config: def save(self, file = None): if file is None: file = self.file - shutil.move(file, file+".backup") + try: + shutil.move(file, file+".backup") + except: + pass + with open(file, 'w') as f: self.doc.writexml(f) @@ -1030,3 +1038,9 @@ if __name__== "__main__": PrettyPrint(site_node, stream=sys.stdout, encoding="utf-8") except: print "xml.dom.ext needs PyXML to be installed!" + + print "FROZEN =", FROZEN + print "EXEC_PATH =", EXEC_PATH + + print "press enter to end" + sys.stdin.readline()