Files
create/src/Tools/MakeApp.py
Chris Hennes e2bb84fd2f [Tools] Fix static analyis issues
This commit addresses issues identified by LGTM for the various
independent (and mostly-independent) files in the Tools subdirectory.
The vast majority of the issues are trivial, and are things like unused
imports or catching BaseException. There was one true bug identified, a
global variable being changed in a function where it was not marked
global, but it only affected output quantity (the variable is named
"VERBOSE"). A couple of other issues identified variables that appear to
represent no-longer-existing options in the code. The options were left,
but a deprecation printout replaces the variable in the event the option
is provided.
2021-02-28 17:53:04 +01:00

37 lines
1.1 KiB
Python

#! python
# -*- coding: utf-8 -*-
# (c) 2003 Werner Mayer LGPL
# Create a new application module
import os,sys
import MakeAppTools
if(len(sys.argv) != 2):
sys.stdout.write("Please enter a name for your application.\n")
sys.exit()
Application = sys.argv[1]
# create directory ../Mod/<Application>
if not os.path.isdir("../Mod/"+Application):
os.mkdir("../Mod/"+Application)
else:
sys.stdout.write(Application + " already exists. Please enter another name.\n")
sys.exit()
# copying files from _TEMPLATE_ to ../Mod/<Application>
sys.stdout.write("Copying files...")
MakeAppTools.copyTemplate("_TEMPLATE_","../Mod/"+Application,"_TEMPLATE_", Application)
sys.stdout.write("Ok\n")
# replace the _TEMPLATE_ string by <Application>
sys.stdout.write("Modifying files...\n")
MakeAppTools.replaceTemplate("../Mod/" + Application,"_TEMPLATE_",Application)
# make the configure script executable
#os.chmod("../Mod/" + Application + "/configure", 0777);
sys.stdout.write("Modifying files done.\n")
sys.stdout.write(Application + " module created successfully.\n")