-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
43 lines (38 loc) · 848 Bytes
/
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
#!/usr/bin/python
import os
from TI import TI
from defaults import DEFAULT_INDIR
### Use the following for testing
# Note that string must be raw.
string = r"""
### Spacing & Capitalization
cCube='GL';
cubesetlogchanges(cCube, 1) ;
path = '\\main-directory\test.txt';
nResult = 10\nDenominator-
Cellgetn('CubeName', 'V1', 'V2', 'V3');
itemskip;
dimensionelementinsertdirect(cDim,'abc','','N');
### Indentation
nIdx=10;
While(nIdx>0);
If (cubeExists(cCube)=1);
cubedestroy(cCube);
else;
cellputn(10\nNoOfYears, 'Fishpaste', 'Actual', '2019.01')
endif;
nIdx=nIdx-1;
end;
"""
tmp1 = TI(text=string)
tmp1.tidy()
tmp1.print_output()
"""
### Tidy all files in in directory
scripts = os.listdir(DEFAULT_INDIR)
for file in scripts:
tmp = TI(infile = DEFAULT_INDIR + '/' + file)
tmp.tidy()
tmp.write_output()
"""
print('TIdying complete!')