You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ssri/ssri.py
+34-19Lines changed: 34 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
importfileinput
9
9
importreadline# I like having inputs work well with navigation - sue me
10
10
importsys
11
+
importasyncio
11
12
# from termcolor import colored
12
13
13
14
# Coloured Outputs Constants
@@ -240,9 +241,7 @@ def getTextForIncludeFile(templateFile): # Returns the contents of the template
240
241
returntextToCopyIn
241
242
242
243
243
-
defwriteTextToFiles(
244
-
templateFile, fileList, verbose
245
-
): # write the provided template file into the fileList (which is actually a set of named tuples)
244
+
asyncdefwriteTextToFiles(templateFile, fileList, verbose): # write the provided template file into the fileList (which is actually a set of named tuples)
246
245
# TODO: Change this to do multithreading - will want to swap out from using fileinput when you do this though
dictOfTemplatesToFiles, numFilesChanged, numWarnings=checkFilesForIncludes(filesToSearch[1], args.templates_dir[0], numFilesChanged, verbose, numWarnings) # this is a dictionary where key is include file an values is a named tuple with fileName and includeText from the files that ask for the key
418
430
431
+
tasks= [writeTextToFiles(template[0], template[1], verbose) fortemplateindictOfTemplatesToFiles.items()] # This might break but heres hoping
result=awaittask# Urgh its late and I have no sleep - there is def a better solution than this but meh
431
446
ifargs.dir:
432
447
print(
433
448
f"{printColour}{includeText} Looked at {fileCreatedCounter} files in {args.inputFile[0]}, found {numFilesChanged} file(s) with include statements (with a total of {numIncludeStatements} include statements found), and output files to {args.output[0]}{CEND}"
0 commit comments