~tribaal/txaws/xss-hardening

« back to all changes in this revision

Viewing changes to txaws/server/registry.py

  • Committer: Free Ekanayaka
  • Date: 2011-08-29 13:59:07 UTC
  • mfrom: (93.1.2 add-onerror)
  • Revision ID: free.ekanayaka@canonical.com-20110829135907-uqcfrgf8463m4tu4
Merge add-onerror [a=fcorrea] [r=free.ekanayaka]

This branch adds support for passing a onerror callback to the registry so
that scanning errors can be handled. Requires venusian1.0a1.

Also, a "fixtures" directory was added to the tests directory, to make it
easy to create packages/modules to test the scanning feature of the registry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        else:
44
44
            return by_version[None]
45
45
 
46
 
    def scan(self, module):
 
46
    def scan(self, module, onerror=None):
47
47
        """Scan the given module object for L{Method}s and register them."""
48
48
        from venusian import Scanner
49
49
        scanner = Scanner(registry=self)
50
 
        scanner.scan(module)
 
50
        scanner.scan(module, onerror=onerror)