Python werkzeug.utils.find_modules() Examples

The following are 14 code examples of werkzeug.utils.find_modules(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module werkzeug.utils , or try the search function .
Example #1
Source File: app.py    From daenerys with Apache License 2.0 5 votes vote down vote up
def mount_sites(self, root):
        for name in find_modules(root, recursive=True):
            mod = import_string(name)
            site = name.split('.')[-1]
            if hasattr(mod, 'site') and site not in self.ignore_sites:
                mod.site.play_actions(target=self) 
Example #2
Source File: __init__.py    From Flask-P2P with MIT License 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #3
Source File: __init__.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #4
Source File: __init__.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #5
Source File: __init__.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #6
Source File: __init__.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #7
Source File: __init__.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #8
Source File: __init__.py    From data with GNU General Public License v3.0 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #9
Source File: __init__.py    From Flask with Apache License 2.0 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #10
Source File: __init__.py    From Flask with Apache License 2.0 5 votes vote down vote up
def iter_suites(package):
    """Yields all testsuites."""
    for module in find_modules(package, include_packages=True):
        mod = __import__(module, fromlist=['*'])
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #11
Source File: utils.py    From Flask with Apache License 2.0 5 votes vote down vote up
def test_find_modules(self):
        self.assert_equal(list(utils.find_modules('werkzeug.debug')), \
            ['werkzeug.debug.console', 'werkzeug.debug.repr',
             'werkzeug.debug.tbtools']) 
Example #12
Source File: __init__.py    From Flask with Apache License 2.0 5 votes vote down vote up
def iter_suites():
    """Yields all testsuites."""
    for module in find_modules(__name__):
        mod = import_string(module)
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #13
Source File: __init__.py    From Flask with Apache License 2.0 5 votes vote down vote up
def iter_suites(package):
    """Yields all testsuites."""
    for module in find_modules(package, include_packages=True):
        mod = __import__(module, fromlist=['*'])
        if hasattr(mod, 'suite'):
            yield mod.suite() 
Example #14
Source File: app.py    From flask-webpack-cookiecutter with MIT License 5 votes vote down vote up
def register_blueprints(app):
    """
    Will find all blueprints within website.views and update them to the app
    """
    view_modules = map(import_string, find_modules("website.views"))

    for view_module in view_modules:
        blueprints = utils.get_classes_of_type(
            view_module,
            Blueprint
        )

        for blueprint in blueprints:
            app.register_blueprint(blueprint)