INNER CODE UNIT · Python

make_file

racenis/tram-sdk · devtools/codegen.py:28

def make_file(name):
	path = prepare_path(os.getcwd()) + name.replace("-", "").lower()
	
	# check if file already generated
	is_h = os.path.isfile(path + ".h")
	is_cpp = os.path.isfile(path + ".cpp")
	
	if is_h:
		print("File", path + ".h", "already exists!")
		sys.exit()
		
	if is_cpp:
		print("File", path + ".cpp", "already exists!")
		sys.exit()
	
	accept = input("Create file " + path + ".h? [y/n]\n")
	
	if accept != "y":

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…