l.s.u.importfascist : module documentation

Part of lp.scripts.utilities

No module docstring
Function text_lines_to_set Undocumented
Function database_import_allowed_into Return True if model code can be imported into the module path.
Function is_test_module Returns True if the module is for unit or functional tests.
Class attrsgetter Like operator.attrgetter, but works on multiple attribute names.
Class JackbootError Import Fascist says you can't make this import.
Class DatabaseImportPolicyViolation Database code is imported directly into other code.
Class FromStarPolicyViolation import * from a module that has no __all__.
Class NotInModuleAllPolicyViolation import of a name that does not appear in a module's __all__.
Class NotFoundPolicyViolation import of zope.exceptions.NotFoundError into lp models modules.
Function import_fascist Undocumented
Function report_naughty_imports Undocumented
Function install_import_fascist Undocumented
def text_lines_to_set(text):
Undocumented
def database_import_allowed_into(module_path):

Return True if model code can be imported into the module path.

It is allowed if:
  • The import was made with the __import__ hook.
  • The importer is a 'test' module.
  • The importer is in a nodule that does not face users.
  • The import is recognised to be dubious, but not a priority to fix.
def is_test_module(module_path):
Returns True if the module is for unit or functional tests.

Otherwise returns False.

def import_fascist(name, globals={}, locals={}, fromlist=, level=-1):
Undocumented
def report_naughty_imports():
Undocumented
def install_import_fascist():
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2018-10-18 00:00:05.