/[navidoc]/navidoc/navidoc/utils/parser.py
ViewVC logotype

Diff of /navidoc/navidoc/utils/parser.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by humppake, Mon Mar 31 09:32:00 2003 UTC revision 1.2 by humppake, Mon Mar 31 15:24:19 2003 UTC
# Line 28  Line 28 
28  __docformat__ = 'reStructuredText'  __docformat__ = 'reStructuredText'
29    
30  import re, random, string  import re, random, string
31    import navidoc
32    
33  def match_remove(p, s):  def match_remove(p, s):
34      """      """
# Line 85  def parse_indented(s): Line 86  def parse_indented(s):
86              stack.append(new)              stack.append(new)
87      return stack[0][1]      return stack[0][1]
88    
89  def keys_for_classes(module):  def keys_for_classes(module, top_class):
90      """      """
91      Gather a key -> class dictionary for all classes containing      Gather a key -> class dictionary for all classes containing
92      'key' in the given module.      'key' in the given module.
# Line 93  def keys_for_classes(module): Line 94  def keys_for_classes(module):
94      d = {}      d = {}
95      for element in dir(module):      for element in dir(module):
96          element = getattr(module, element)          element = getattr(module, element)
97          if type(element) == type(Element) \          if type(element) == type(top_class) \
98                         and issubclass(element, Element):                         and issubclass(element, top_class):
             print element  
99              if hasattr(element, "key") \              if hasattr(element, "key") \
100                     and type(element.key) == type(''):                     and type(element.key) == type(''):
101                  d[element.key] = element                  d[element.key] = element

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26