move the test for frozen executable over to utils

nanotube [2007-01-10 22:01]
move the test for frozen executable over to utils
Filename
myutils.py
diff --git a/myutils.py b/myutils.py
index 7613c19..183dd2c 100644
--- a/myutils.py
+++ b/myutils.py
@@ -1,12 +1,17 @@
 import zlib
 import base64
+import sys
+import imp

 def password_obfuscate(password):
     return base64.b64encode(zlib.compress(password))
 def password_recover(password):
     return zlib.decompress(base64.b64decode(password))

-
+def main_is_frozen():
+    return (hasattr(sys, "frozen") or # new py2exe
+            hasattr(sys, "importers") or # old py2exe
+            imp.is_frozen("__main__")) # tools/freeze


 #~ if __name__ == '__main__':
ViewGit