-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgenerate.py
More file actions
37 lines (29 loc) · 1.08 KB
/
Copy pathgenerate.py
File metadata and controls
37 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import yaml
import string
import argparse
from ModuleGenerator import ModuleGenerator
from datetime import date
def getDate():
today = date.today()
return today.strftime("%m/%d/%Y")
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Create a new C module from templates')
# Required positional argument
parser.add_argument('Name', type=str,
help='Module name to create')
# Optional positional argument
parser.add_argument('opt_outputPath', type=str, nargs='?',
help='An optional output path argument')
args = parser.parse_args()
if args.opt_outputPath is None:
outputPath = ""
else:
outputPath = args.opt_outputPath + "/"
# Get the configuration for the author and company information
stream = open("config/config.yaml", 'r')
config = yaml.safe_load(stream)
author = config.get("author")
company = config.get("company")
# Generate the output modules
Module = ModuleGenerator(author, getDate(), args.Name, company, outputPath)
Module.Make()