Revision: 4683 http://geany.svn.sourceforge.net/geany/?rev=4683&view=rev Author: eht16 Date: 2010-02-21 13:29:46 +0000 (Sun, 21 Feb 2010)
Log Message: ----------- Minor fixes.
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/genapi.py
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-02-21 13:23:55 UTC (rev 4682) +++ trunk/ChangeLog 2010-02-21 13:29:46 UTC (rev 4683) @@ -3,6 +3,8 @@ * scripts/create_py_tags.py: Minor fixes. Replace tabs by spaces. + * plugins/genapi.py: + Minor fixes.
2010-02-20 Dominic Hopf <dmaphy(at)googlemail(dot)com>
Modified: trunk/plugins/genapi.py =================================================================== --- trunk/plugins/genapi.py 2010-02-21 13:23:55 UTC (rev 4682) +++ trunk/plugins/genapi.py 2010-02-21 13:29:46 UTC (rev 4683) @@ -34,25 +34,22 @@
def get_function_names(): names = [] - try: - f = open('../src/plugins.c') - while 1: - l = f.readline() - if l == "": - break; - m = re.match("^\t&([a-z][a-z0-9_]+)", l) - if m: - s = m.group(1) - if not s.endswith('_funcs'): - names.append(s) - f.close - except: - pass + filep = open('../src/plugins.c') + while 1: + line = filep.readline() + if line == "": + break + match = re.match("^\t&([a-z][a-z0-9_]+)", line) + if match: + symbol = match.group(1) + if not symbol.endswith('_funcs'): + names.append(symbol) + filep.close() return names
-def get_api_tuple(str): - m = re.match("^([a-z]+)_([a-z][a-z0-9_]+)$", str) - return 'p_' + m.group(1), m.group(2) +def get_api_tuple(source): + match = re.match("^([a-z]+)_([a-z][a-z0-9_]+)$", source) + return 'p_' + match.group(1), match.group(2)
header = \ @@ -83,15 +80,15 @@ sys.exit("No function names read!")
f = open(outfile, 'w') - print >>f, header % (outfile) + print >> f, header % (outfile)
for fname in fnames: ptr, name = get_api_tuple(fname) # note: name no longer needed - print >>f, '#define %s \\n\tgeany_functions->%s->%s' % (fname, ptr, fname) + print >> f, '#define %s \\n\tgeany_functions->%s->%s' % (fname, ptr, fname)
- print >>f, '\n#endif' - f.close + print >> f, '\n#endif' + f.close()
if not '-q' in sys.argv: print 'Generated ' + outfile
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.