~testdoc-dev/testdoc/trunk.git

« back to all changes in this revision

Viewing changes to testdoc/documenter.py

  • Committer: Jonathan Lange
  • Date: 2010-09-08 11:42:24 UTC
  • mfrom: (14.1.10)
  • Revision ID: git-v1:f0940e6c8fd4eecfe0d9de582f5daa0eaf6c695f
More formatters!

 * REST, Moin and Shiny formatters
 * Bug 120141 is fixed, testdoc no longer generates documentation for 
   imported tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
def gen_split_name(name,
20
20
                   wordRE=re.compile(
21
21
                       r'[0-9]+|[A-Z]?(?:(?:[A-Z](?![a-z]))+|[a-z]*)')):
 
22
    underscores = ''
22
23
    for word in name.split('_'):
 
24
        if word == '':
 
25
            underscores += '_'
23
26
        for bit in wordRE.findall(word):
24
27
            if len(bit) == 0:
25
28
                continue
26
29
            if len(bit) > 1 and bit.upper() == bit:
27
 
                yield bit
 
30
                yield underscores + bit
28
31
            else:
29
 
                yield bit.lower()
 
32
                yield underscores + bit.lower()
 
33
            underscores = ''
30
34
 
31
35
 
32
36
def title_case(words):
56
60
        return module_name
57
61
 
58
62
    def format_test(self, test_name):
59
 
        return title_case(split_name(test_name)[1:])
 
63
        return title_case(split_name(test_name)[1:]).lstrip()
60
64
 
61
65
    def format_test_class(self, class_name):
62
66
        return title_case(