12 |
# |
# |
13 |
# Changelog: |
# Changelog: |
14 |
# $Log$ |
# $Log$ |
15 |
|
# Revision 1.4 2002/11/12 22:22:25 jonen |
16 |
|
# + added support for concurrent pygtk installations |
17 |
|
# |
18 |
|
# Revision 1.3 2002/11/12 20:14:48 jonen |
19 |
|
# + php functions maybe prefixed by a '&'. fixed sigpart regex. |
20 |
|
# + forgot 'class' (php) after all. fixed regex. |
21 |
|
# + renamed regex_perl to regex_noparenthesis |
22 |
|
# + perl subs with an space after the first '{' weren't regognized. fixed regex. |
23 |
|
# |
24 |
# Revision 1.2 2002/11/08 02:37:25 jonen |
# Revision 1.2 2002/11/08 02:37:25 jonen |
25 |
# + added cvs header |
# + added cvs header |
26 |
# + added hook for refresh on "save-file" |
# + added hook for refresh on "save-file" |
36 |
import os |
import os |
37 |
sys.argv=[] |
sys.argv=[] |
38 |
sys.argv.append("null") |
sys.argv.append("null") |
39 |
|
try: |
40 |
|
import pygtk |
41 |
|
pygtk.require("1.2") |
42 |
|
except: |
43 |
|
pass |
44 |
from gtk import * |
from gtk import * |
45 |
import _gtk |
import _gtk |
46 |
import _gnome |
import _gnome |
57 |
# class/function/sub/packages signatures |
# class/function/sub/packages signatures |
58 |
# in source code |
# in source code |
59 |
prefix_pattern = '^[|\s]*' |
prefix_pattern = '^[|\s]*' |
60 |
sigpart = '\s+([\w|:]+?)\s*' |
sigpart = '\s+([\w|:|&]+?)\s*' |
61 |
regex_universal=re.compile(prefix_pattern + '(?:\w+?)\*??' + sigpart + '\(.*?\)[\s|:|{]*$') |
regex_universal=re.compile(prefix_pattern + '(?:\w+?)\*??' + sigpart + '\(.*?\)[\s|:|{]*\s*$') |
62 |
regex_perl=re.compile(prefix_pattern + '(?:package|sub)' + sigpart + '[;|{]$') |
regex_noparenthesis=re.compile(prefix_pattern + '(?:package|sub|class)' + sigpart + '[;|{]\s*$') |
63 |
|
|
64 |
def get_functionNameFromLine(str): |
def get_functionNameFromLine(str): |
65 |
for regex in (regex_universal, regex_perl): |
for regex in (regex_universal, regex_noparenthesis): |
66 |
match=regex.search(str) |
match=regex.search(str) |
67 |
if match: |
if match: |
68 |
str = match.group(1) |
str = match.group(1) |