-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.py
executable file
·30 lines (26 loc) · 881 Bytes
/
Test.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
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from TextProc.CommentReplace import *
from TextProc.GeneralReplace import *
from TextProc.TextProcessor import *
if __name__ == '__main__':
def handle(content):
return content.replace('****Die****', '****Live****')
# t = TextProcessor('./test/a')
# t.addReplace(ASingleLineComment)
# t.addReplace(CSingleLineComment)
# t.addReplace(CMultiLineComment)
# t.addReplace(AMultiLineComment)
# t.addReplace(ALiteralString)
# t.addReplace(DLiteralString)
# t.addHandle(handle)
# t.sequenceProcess()
t = TextProcessor('./test/a')
t.addReplace(ASingleLineComment)
t.addReplace(CSingleLineComment)
t.addReplace(CMultiLineComment)
t.addReplace(AMultiLineComment)
t.addReplace(ALiteralString)
t.addReplace(DLiteralString)
t.addHandle(handle)
t.centerProcess()