50 lines
1.0 KiB
Python
Executable File
50 lines
1.0 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
#rr = open('read_me.doc', 'r', encoding='UTF-8')
|
|
rr = open('include/widget.h', 'r', encoding='UTF-8')
|
|
ww = open('scripts/junk', "w")
|
|
|
|
l = [None] * 75
|
|
n = -1
|
|
|
|
for line in rr:
|
|
if (line [0:4] == 'void'
|
|
or line [0:3] == 'int'
|
|
or line [0:4] == 'char'
|
|
or line [0:8] == 'GtkEntry'):
|
|
n += 1
|
|
l[n] = line.split(' ')[1]
|
|
if (len(l[n]) > 0
|
|
and l[n][0] == '*'):
|
|
l[n] = l[n][1:]
|
|
|
|
for line in rr:
|
|
if (line [0:10] == 'const char'
|
|
or line [0:17] == 'struct TreeNode_t'):
|
|
n += 1
|
|
l[n] = line.split(' ')[2]
|
|
if (len(l[n]) > 0
|
|
and l[n][0] == '*'):
|
|
l[n] = l[n][1:]
|
|
|
|
|
|
#l.sort()
|
|
n = -1
|
|
for line in l:
|
|
n += 1
|
|
if (line == None):
|
|
line = "None"
|
|
if (n in range(69)):
|
|
if (line[-1:] == '\n'):
|
|
line = line[:-1]
|
|
if (line[-3:] == '();'):
|
|
line = line[:-3]
|
|
#line = str(n) + ' ' + line
|
|
print(line)
|
|
line = line + '\n'
|
|
ww.write(line)
|
|
|
|
rr.close()
|
|
ww.close()
|
|
|