Skip to content

Commit

Permalink
Removed old argument parser from xml2palette
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Aug 12, 2022
1 parent 4227874 commit ad4b759
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions tools/xml2palette/xml2palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,45 +120,6 @@ def get_args():
language = Language.C if args.c else Language.PYTHON
return args.idir, args.tag, args.ofile, args.parse_all, args.module_path, language


def get_options_from_command_line(argv):
inputdir = ""
tag = ""
outputfile = ""
allow_missing_eagle_start = False
module_path = ""
language = Language.UNKNOWN
try:
opts, args = getopt.getopt(argv, "hi:t:o:sm:cp", ["idir=", "tag=", "ofile="])
except getopt.GetoptError:
print("xml2palette.py -i <input_directory> -t <tag> -o <output_file>")
sys.exit(2)

if len(opts) < 2:
print("xml2palette.py -i <input_directory> -t <tag> -o <output_file>")
sys.exit()

for opt, arg in opts:
if opt == "-h":
print("xml2palette.py -i <input_directory> -t <tag> -o <output_file>")
sys.exit()
elif opt in ("-i", "--idir"):
inputdir = arg
elif opt in ("-t", "--tag"):
tag = arg
elif opt in ("-o", "--ofile"):
outputfile = arg
elif opt in ("-s"):
allow_missing_eagle_start = True
elif opt in ("-m", "--module"):
module_path = arg
elif opt in ("-c"):
language = Language.C
elif opt in ("-p"):
language = Language.PYTHON
return inputdir, tag, outputfile, allow_missing_eagle_start, module_path, language


def check_environment_variables():
required_environment_variables = ["PROJECT_NAME", "PROJECT_VERSION", "GIT_REPO"]

Expand Down Expand Up @@ -1083,7 +1044,6 @@ def parseCasaDocs(dStr:str) -> dict:
# read environment variables
if not check_environment_variables():
sys.exit(1)
# (inputdir, tag, outputfile, allow_missing_eagle_start, module_path, language) = get_options_from_command_line(sys.argv[1:])
(inputdir, tag, outputfile, allow_missing_eagle_start, module_path, language) =\
get_args()

Expand Down

0 comments on commit ad4b759

Please sign in to comment.