Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return 1
def lookForConfig(sFile, lsPath):
for sPath in lsPath:
s = sPath+os.sep+sFile
print "Looking for ", s,
if os.path.exists(s):
print "OK"
return s
else:
print "FAILED"
print "No config file %s in %s" % (sFile, lsPath)
sys.exit(1)
if __name__ == "__main__":
deco.setEncoding(sEncoding)
sFile = None
print sys.argv
try:
sPath = sys.argv[1]
try:
sFile = sys.argv[2]
if not os.path.exists(sFile) and len(sys.argv)>3:
#maybe we have a space in the file name... :-( and it is a mess with windows and .bat
if os.path.exists(sys.argv[2] + " " + sys.argv[3]):
sFile = sys.argv[2] + " " + sys.argv[3]
except IndexError:
pass
except IndexError:
sConfigFileName = "wxvisu.ini"