b.l.ImportProcessor(object) : class documentation

Part of bzrlib.lazy_import View In Hierarchy

Convert text that users input into lazy import requests
Method __init__ Undocumented
Method lazy_import Convert the given text into a bunch of lazy import objects.
Method _convert_imports Undocumented
Method _build_map Take a string describing imports, and build up the internal map
Method _convert_import_str This converts a import string into an import map.
Method _convert_from_str This converts a 'from foo import bar' string into an import map.
Method _canonicalize_import_text Take a list of imports, and split it into regularized form.
def __init__(self, lazy_import_class=None):
Undocumented
def lazy_import(self, scope, text):
Convert the given text into a bunch of lazy import objects.

This takes a text string, which should be similar to normal python import markup.

def _convert_imports(self, scope):
Undocumented
def _build_map(self, text):
Take a string describing imports, and build up the internal map
def _convert_import_str(self, import_str):
This converts a import string into an import map.

This only understands 'import foo, foo.bar, foo.bar.baz as bing'

Parametersimport_strThe import string to process
def _convert_from_str(self, from_str):
This converts a 'from foo import bar' string into an import map.
Parametersfrom_strThe import string to process
def _canonicalize_import_text(self, text):
Take a list of imports, and split it into regularized form.

This is meant to take regular import text, and convert it to the forms that the rest of the converters prefer.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.