-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
48 lines (40 loc) · 1.6 KB
/
main.py
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
38
39
40
41
42
43
44
45
46
47
48
import sys, getopt, os, time
import populateDict
import printHTMLList
import utility
# Optional
import printToText
import minify
utility.getArguments(sys.argv[1:])
indirName = "Input Directory "+utility.indir;
outputFile = "Output File "+utility.outfile;
utility.verbosePrint(indirName, utility.verbose)
utility.verbosePrint(outputFile, utility.verbose)
# Calculate getAllFilesinDir time
start_time = time.time()
reqFiles = printHTMLList.getAllFilesinDir(utility.indir);
reqFilesTime = time.time() - start_time
stmt = "Function getAllFilesinDir "+str(reqFilesTime)+"sec"
utility.verbosePrint(stmt, utility.verbose)
# Calculate populateDict time
start_time = time.time()
words = populateDict.populateDict(reqFiles);
populateDictTime = time.time() - start_time
stmt = "Function populateDict "+str(populateDictTime)+"sec"
utility.verbosePrint(stmt, utility.verbose)
# Calculate printToHTMLCompleteList time
start_time = time.time()
printHTMLList.printToHTMLCompleteList(words, utility.outfile);
printToHTMLCompleteListTime = time.time() - start_time
stmt = "Function printToHTMLCompleteList "+str(printToHTMLCompleteListTime)+"sec"
utility.verbosePrint(stmt, utility.verbose)
if utility.minifyOpt:
minify.minifyFile(utility.outfile, utility.outfile)
# ## Optional
# # Calculate printToText time
# # start_time = time.time()
# # printToText.printToText(words);
# # printToTextTime = time.time() - start_time
# # print( 'Function printToText ' , printToTextTime, 'sec')
# # minify.minifyFile("js/search.js", "js/search-min.js")
# # minify.minifyFile("index.html", "index-min.html")