Add EXEC_PATH to constants.

This commit is contained in:
Eratosthenes 2010-02-09 18:51:37 -05:00
parent 9f27ddabad
commit 965adc7b27

View File

@ -166,6 +166,10 @@ if LOCALE_ENCODING == "US-ASCII":
# needs LOCALE_ENCODING (above), imported for sqlite setup in Config class below # needs LOCALE_ENCODING (above), imported for sqlite setup in Config class below
FROZEN = hasattr(sys, "frozen")
EXEC_PATH = get_exec_path()
import Charset import Charset
@ -613,7 +617,11 @@ class Config:
def save(self, file = None): def save(self, file = None):
if file is None: if file is None:
file = self.file file = self.file
try:
shutil.move(file, file+".backup") shutil.move(file, file+".backup")
except:
pass
with open(file, 'w') as f: with open(file, 'w') as f:
self.doc.writexml(f) self.doc.writexml(f)
@ -1030,3 +1038,9 @@ if __name__== "__main__":
PrettyPrint(site_node, stream=sys.stdout, encoding="utf-8") PrettyPrint(site_node, stream=sys.stdout, encoding="utf-8")
except: except:
print "xml.dom.ext needs PyXML to be installed!" 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()