from os import listdir, system
from subprocess import call
from ntpath import basename
input_dir = 'input'
output_dir = 'output'
processing_app = 'texgloc.exe'
def processing_args(input_file_path):
def output_file_path(input_file_path):
return output_dir + "\\" + input_file_path
ainput = input_dir + "\\" + input_file_path
aoutput = output_file_path(input_file_path)
#aprec = "3" #3/5/7
#ascale = "2"
#aalpha = "1" # <= 3.f
#abeta = "20" # <= 255
aargs = [ainput, aoutput]#, aprec, ascale, aalpha, abeta]
result = " ".join(aargs)
print("args: " + result)
return result
def call_variations(ipath):
ainput = input_dir + "/" + ipath
aoutput = output_dir + "/" + ipath
for prec in [3, 5, 7]:
for scale in [1, 1.8, 2.6, 3.4]:
for alpha in [0.2, 1.2, 2.2, 3.0]:
for beta in range(20, 255, 80):
iterators_str_list = list(map(str, [prec, scale, alpha, beta]))
aoutput = output_dir + "/" + "-".join(iterators_str_list) + "-" + ipath
process([ainput, aoutput] + iterators_str_list)
def process(aargs):
procedure = processing_app + " " + " ".join(aargs)
print(procedure)
system(procedure)
input_files = listdir(input_dir)
[call_variations(ipath) for ipath in input_files]
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}