~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_source.py

  • Committer: Gary van der Merwe
  • Date: 2010-08-02 19:56:52 UTC
  • mfrom: (5050.3.18 2.2)
  • mto: (5050.3.19 2.2)
  • mto: This revision was merged to the branch mainline in revision 5371.
  • Revision ID: garyvdm@gmail.com-20100802195652-o1ppjemhwrr98i61
MergeĀ lp:bzr/2.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
# Files which are listed here will be skipped when testing for Copyright (or
42
42
# GPL) statements.
43
 
COPYRIGHT_EXCEPTIONS = [
44
 
    'bzrlib/_bencode_py.py',
45
 
    'bzrlib/doc_generate/conf.py',
46
 
    'bzrlib/lsprof.py',
47
 
    ]
 
43
COPYRIGHT_EXCEPTIONS = ['bzrlib/lsprof.py', 'bzrlib/_bencode_py.py',
 
44
    'bzrlib/doc_generate/sphinx_conf.py']
48
45
 
49
 
LICENSE_EXCEPTIONS = [
50
 
    'bzrlib/_bencode_py.py',
51
 
    'bzrlib/doc_generate/conf.py',
52
 
    'bzrlib/lsprof.py',
53
 
    ]
 
46
LICENSE_EXCEPTIONS = ['bzrlib/lsprof.py', 'bzrlib/_bencode_py.py',
 
47
    'bzrlib/doc_generate/sphinx_conf.py']
54
48
# Technically, 'bzrlib/lsprof.py' should be 'bzrlib/util/lsprof.py',
55
49
# (we do not check bzrlib/util/, since that is code bundled from elsewhere)
56
50
# but for compatibility with previous releases, we don't want to move it.
388
382
        """
389
383
        both_exc_and_no_exc = []
390
384
        missing_except = []
391
 
        class_re = re.compile(r'^(cdef\s+)?(public\s+)?'
392
 
                              r'(api\s+)?class (\w+).*:', re.MULTILINE)
393
 
        extern_class_re = re.compile(r'## extern cdef class (\w+)',
394
 
                                     re.MULTILINE)
 
385
        class_re = re.compile(r'^(cdef\s+)?(public\s+)?(api\s+)?class (\w+).*:',
 
386
                              re.MULTILINE)
395
387
        except_re = re.compile(r'cdef\s+' # start with cdef
396
388
                               r'([\w *]*?)\s*' # this is the return signature
397
389
                               r'(\w+)\s*\(' # the function name
402
394
        for fname, text in self.get_source_file_contents(
403
395
                extensions=('.pyx',)):
404
396
            known_classes = set([m[-1] for m in class_re.findall(text)])
405
 
            known_classes.update(extern_class_re.findall(text))
406
397
            cdefs = except_re.findall(text)
407
398
            for sig, func, exc_clause, no_exc_comment in cdefs:
408
399
                if sig.startswith('api '):