Skip to content

Commit

Permalink
add tr.py. pick strings from c source
Browse files Browse the repository at this point in the history
  • Loading branch information
Brock committed Jan 27, 2015
1 parent b6c7854 commit c417d35
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 0 deletions.
Binary file removed DSFS/files/config.bmp
Binary file not shown.
Binary file removed DSFS/files/config.gif
Binary file not shown.
Binary file removed DSFS/files/config.jpg
Binary file not shown.
Binary file removed DSFS/files/config.png
Binary file not shown.
Binary file removed files/config.bmp
Binary file not shown.
Binary file removed files/config.gif
Binary file not shown.
Binary file removed files/config.jpg
Binary file not shown.
Binary file removed files/config.png
Binary file not shown.
34 changes: 34 additions & 0 deletions tr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python
# _*_ encoding: utf-8 _*_

import sys, os
import re

lineNum = 0
pos = 0
startLine = 0;
startPos = 0;
prev = ''
flag = 0
str = ''

for line in open(sys.argv[1]).readlines():
lineNum += 1
pos = 0
for c in line:
if c == '\"' and prev != '\\':
if flag == 0:
flag += 1
startLine = lineNum
startPos = pos
elif flag == 1:
str += c
if re.search('[+s]*#', line) == None:
print "%d:%d - %d:%d %s" % (startLine, startPos, lineNum, pos, str)
str = ''
flag = 0
if flag == 1:
str += c;
prev = c
pos += 1

0 comments on commit c417d35

Please sign in to comment.