How to use the deco.setEncoding function in deco

To help you get started, we’ve selected a few deco examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Transkribus / TranskribusDU / TranskribusDU / visu / mpxml_viewer.bat.py View on Github external
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"

deco

A decorator for concurrency

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis