29
29
#
30
30
import sys
31
31
import os
32
- import csv # @UnusedImport
33
- import urllib # @UnusedImport
32
+ import csv # @UnusedImport
33
+ import urllib # @UnusedImport
34
34
try :
35
- import hashlib # @UnusedImport
35
+ import hashlib # @UnusedImport
36
36
except ImportError :
37
- import md5 #@UnusedImport
38
- import unittest #@UnusedImport
39
- import platform #@UnusedImport
40
- import sre_compile #@UnusedImport
41
- import shutil #@UnusedImport
37
+ import md5 # @UnusedImport
38
+ import unittest # @UnusedImport
39
+ import platform # @UnusedImport
40
+ import sre_compile # @UnusedImport
41
+ import shutil # @UnusedImport
42
+
42
43
43
44
def WeAreFrozen ():
44
45
return hasattr (sys , "frozen" )
45
46
47
+
46
48
def ModulePath ():
47
49
if WeAreFrozen ():
48
- return os .path .dirname (unicode (sys .executable , sys .getfilesystemencoding ()))
50
+ return os .path .dirname (
51
+ unicode (sys .executable , sys .getfilesystemencoding ()))
49
52
return os .path .dirname (unicode (__file__ , sys .getfilesystemencoding ()))
50
53
51
- def GetRuntimePath () :
54
+
55
+ def GetRuntimePath ():
52
56
"Return the path of this tool"
53
- if (sys .platform == "win32" ) :
54
- runtimePath = ModulePath ();
55
- else :
57
+ if (sys .platform == "win32" ):
58
+ runtimePath = ModulePath ()
59
+ else :
56
60
modename = globals ()['__name__' ]
57
61
module = sys .modules [modename ]
58
62
runtimePath = os .path .dirname (module .__file__ )
@@ -63,4 +67,3 @@ def GetRuntimePath() :
63
67
sys .path .append (GetRuntimePath ())
64
68
module = __import__ ("nsiqcppstyle_exe" )
65
69
sys .exit (module .main ())
66
-
0 commit comments