Add EXEC_PATH to constants.
This commit is contained in:
parent
9f27ddabad
commit
965adc7b27
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user