35 |
""" |
""" |
36 |
match_remove(p, s) |
match_remove(p, s) |
37 |
|
|
38 |
Match pattern p in s and remove the match, return (match, ns). |
Match pattern p in s and remove the match, return match and the |
39 |
|
rest of the string.). |
40 |
""" |
""" |
41 |
m = re.match(p,s) |
m = re.match(p,s) |
42 |
if m: s = re.sub(p, "", s) |
if m: s = re.sub(p, "", s) |
52 |
|
|
53 |
def init_spaces(s, tokenize=0): |
def init_spaces(s, tokenize=0): |
54 |
""" |
""" |
55 |
init_spaces(s) |
init_spaces(s, tokenize=0) |
56 |
|
|
57 |
Strip whitespaces and calculates the amount of them in the |
Strip whitespaces and calculates the amount of them in the |
58 |
beginning of the string. Return the amount and stripped |
beginning of the string. Return the amount and stripped |
76 |
|
|
77 |
def parse_indented(s, tokenize=1): |
def parse_indented(s, tokenize=1): |
78 |
""" |
""" |
79 |
parse_indented(s, tokenize=true) |
parse_indented(s, tokenize=1) |
80 |
|
|
81 |
Split the string into lines after "\n"s. Parse the string |
Split the string into lines after "\n"s. Parse the string |
82 |
array into array tree after indentions in consecutive strings. |
array into array tree after indentions in consecutive strings. |
106 |
""" |
""" |
107 |
keys_for_classes(module, top_class) |
keys_for_classes(module, top_class) |
108 |
|
|
109 |
Gather a key -> class dictionary for all classes containing |
Gather a key -> class dictionary for all subclasses of top_class |
110 |
'key' in the given module. In Navidoc this is used to |
containing 'key' in the given module. In Navidoc this is used to |
111 |
collect UML elements from modules. |
collect UML elements from modules. |
112 |
""" |
""" |
113 |
d = {} |
d = {} |