src/aoikhotkeydep/aoikimportutil.py
def load_obj_http(
    uri,
    mod_name=None,
    sys_use=True,
    sys_add=True,
    mod_attr_sep='::',
    attr_chain_sep='.',
    retn_mod=False,
    uri_parts=None,
):
    """Load an object from a remote module file downloaded via HTTP.

    @param uri: specify the remote module file's location and which attribute
    object to load.
    # load the module object
    https://localhost/aoikimportutil/aoikimportutil.py

    # load the module object, get its attribute object |load_obj_http|.
    https://localhost/aoikimportutil/aoikimportutil.py::load_obj_http

    @param mod_name: module name to be imported as.

    @param sys_use: see func |import_module_by_code|'s same name arg.

    @param sys_add: see func |import_module_by_code|'s same name arg.

    @param mod_attr_sep: see func |load_obj|'s same name arg.

    @param attr_chain_sep: see func |load_obj|'s same name arg.

    @retn_mod: see func |load_obj|'s same name arg.
    """
    #
    if uri_parts is None:
        uri_parts = uri_split(uri=uri, mod_attr_sep=mod_attr_sep)

    _, file_url, attr_chain = uri_parts

    #
    # |None| or |''|
    if not mod_name:
        # use file name as module name
        _, file_name = os.path.split(file_url)

        mod_name, _ = os.path.splitext(file_name)

        # should not happen, but just in case
        if not mod_name:
            raise ValueError(
                'Module name can not be inferred from the URI.\n URI is |%s|'
                % uri)

    #
    # assert mod_name

    mod_obj = import_module_by_http(
        uri=file_url,
        mod_name=mod_name,
        sys_use=sys_use,
        sys_add=sys_add,
    )

    #
    if not attr_chain:
        if retn_mod:
            return mod_obj, None
        else:
            return mod_obj

    #
    # assert attr_chain

    attr_obj = getattr_chain(
        obj=mod_obj,
        attr_chain=attr_chain,
        sep=attr_chain_sep,
    )
    # raise error

    #
    if retn_mod:
        return mod_obj, attr_obj
    else:
        return attr_obj
Load an object from a remote module file downloaded via HTTP.

    @param uri: specify the remote module file's location and which attribute
    object to load.
    # load the module object
    https://localhost/aoikimportutil/aoikimportutil.py

    # load the module object, get its attribute object |load_obj_http|.
    https://localhost/aoikimportutil/aoikimportutil.py::load_obj_http

    @param mod_name: module name to be imported as.

    @param sys_use: see func |import_module_by_code|'s same name arg.

    @param sys_add: see func |import_module_by_code|'s same name arg.

    @param mod_attr_sep: see func |load_obj|'s same name arg.

    @param attr_chain_sep: see func |load_obj|'s same name arg.

    @retn_mod: see func |load_obj|'s same name arg.
    
Load an object from a remote module file downloaded via HTTP.
Load an object from a remote module file downloaded via HTTP .
def load_obj_http(
    uri,
    mod_name=None,
    sys_use=True,
    sys_add=True,
    mod_attr_sep='::',
    attr_chain_sep='.',
    retn_mod=False,
    uri_parts=None,
):
    if uri_parts is None:
        uri_parts = uri_split(uri=uri, mod_attr_sep=mod_attr_sep)
    _, file_url, attr_chain = uri_parts
     |None| or |''|
    if not mod_name:
         use file name as module name
        _, file_name = os.path.split(file_url)
        mod_name, _ = os.path.splitext(file_name)
         should not happen, but just in case
        if not mod_name:
            raise ValueError(
                'Module name can not be inferred from the URI.\n URI is |%s|'
                % uri)
     assert mod_name
    mod_obj = import_module_by_http(
        uri=file_url,
        mod_name=mod_name,
        sys_use=sys_use,
        sys_add=sys_add,
    )
    if not attr_chain:
        if retn_mod:
            return mod_obj, None
        else:
            return mod_obj
     assert attr_chain
    attr_obj = getattr_chain(
        obj=mod_obj,
        attr_chain=attr_chain,
        sep=attr_chain_sep,
    )
     raise error
    if retn_mod:
        return mod_obj, attr_obj
    else:
        return attr_obj
def load_obj_http ( uri , mod_name = None , sys_use = True , sys_add = True , mod_attr_sep = '::' , attr_chain_sep = '.' , retn_mod = False , uri_parts = None , ) : if uri_parts is None : uri_parts = uri_split ( uri = uri , mod_attr_sep = mod_attr_sep ) _ , file_url , attr_chain = uri_parts if not mod_name : _ , file_name = os . path . split ( file_url ) mod_name , _ = os . path . splitext ( file_name ) if not mod_name : raise ValueError ( 'Module name can not be inferred from the URI.\n URI is |%s|' % uri ) mod_obj = import_module_by_http ( uri = file_url , mod_name = mod_name , sys_use = sys_use , sys_add = sys_add , ) if not attr_chain : if retn_mod : return mod_obj , None else : return mod_obj attr_obj = getattr_chain ( obj = mod_obj , attr_chain = attr_chain , sep = attr_chain_sep , ) if retn_mod : return mod_obj , attr_obj else : return attr_obj
Load an object from a remote module file downloaded via HTTP.
Load an object from a remote module file downloaded via HTTP .
"""Load an object from a remote module file downloaded via HTTP.

    @param uri: specify the remote module file's location and which attribute
    object to load.
    # load the module object
    https://localhost/aoikimportutil/aoikimportutil.py

    # load the module object, get its attribute object |load_obj_http|.
    https://localhost/aoikimportutil/aoikimportutil.py::load_obj_http

    @param mod_name: module name to be imported as.

    @param sys_use: see func |import_module_by_code|'s same name arg.

    @param sys_add: see func |import_module_by_code|'s same name arg.

    @param mod_attr_sep: see func |load_obj|'s same name arg.

    @param attr_chain_sep: see func |load_obj|'s same name arg.

    @retn_mod: see func |load_obj|'s same name arg.
    """ # # # |None| or |''| # use file name as module name # should not happen, but just in case # # assert mod_name # # # assert attr_chain # raise error #
uri
specify the remote module file's location and which attribute
object to load.

load the module object, get its attribute object |load_obj_http|.
specify the remote module file ' s location and which attribute object to load . load the module object get its attribute object |load_obj_http| .
mod_name
module name to be imported as.
module name to be imported as .
sys_use
see func |import_module_by_code|'s same name arg.
see func |import_module_by_code| ' s same name arg .
sys_add
see func |import_module_by_code|'s same name arg.
see func |import_module_by_code| ' s same name arg .
mod_attr_sep
see func |load_obj|'s same name arg.
see func |load_obj| ' s same name arg .
attr_chain_sep
see func |load_obj|'s same name arg.
see func |load_obj| ' s same name arg .
retn_mod
uri_parts
retn_mod
see func |load_obj|'s same name arg.
see func |load_obj| ' s same name arg .