def _consider(self, constraint_collection, module_filename, module_package): assert module_package is None or (type(module_package) is str and module_package != "") module_filename = Utils.normpath(module_filename) if Utils.isDir(module_filename): module_name = Utils.basename(module_filename) elif module_filename.endswith(".py"): module_name = Utils.basename(module_filename)[:-3] else: module_name = None if module_name is not None: decision = self._decide(module_filename, module_name, module_package) if decision: module_relpath = Utils.relpath(module_filename) return self._recurseTo( constraint_collection=constraint_collection, module_package=module_package, module_filename=module_filename, module_relpath=module_relpath) elif decision is None: if module_package is None: module_fullpath = module_name else: module_fullpath = module_package + "." + module_name if module_filename not in self._warned_about: self._warned_about.add(module_filename) warning( # long message, but shall be like it, pylint: disable=C0301 """\ Not recursing to '%(full_path)s' (%(filename)s), please specify \ --recurse-none (do not warn), \ --recurse-all (recurse to all), \ --recurse-not-to=%(full_path)s (ignore it), \ --recurse-to=%(full_path)s (recurse to it) to change.""" % { "full_path": module_fullpath, "filename": module_filename })
def _consider( self, constraint_collection, module_filename, module_package ): assert module_package is None or ( type( module_package ) is str and module_package != "" ) module_filename = Utils.normpath( module_filename ) if Utils.isDir( module_filename ): module_name = Utils.basename( module_filename ) elif module_filename.endswith( ".py" ): module_name = Utils.basename( module_filename )[:-3] else: module_name = None if module_name is not None: decision = self._decide( module_filename, module_name, module_package ) if decision: module_relpath = Utils.relpath( module_filename ) return self._recurseTo( constraint_collection = constraint_collection, module_package = module_package, module_filename = module_filename, module_relpath = module_relpath ) elif decision is None: if module_package is None: module_fullpath = module_name else: module_fullpath = module_package + "." + module_name if module_filename not in self._warned_about: self._warned_about.add( module_filename ) warning( # long message, but shall be like it, pylint: disable=C0301 """\ Not recursing to '%(full_path)s' (%(filename)s), please specify \ --recurse-none (do not warn), \ --recurse-all (recurse to all), \ --recurse-not-to=%(full_path)s (ignore it), \ --recurse-to=%(full_path)s (recurse to it) to change.""" % { "full_path" : module_fullpath, "filename" : module_filename } )
def considerFilename( module_filename, module_package ): assert module_package is None or ( type( module_package ) is str and module_package != "" ) module_filename = Utils.normpath( module_filename ) if Utils.isDir( module_filename ): module_filename = Utils.abspath( module_filename ) module_name = Utils.basename( module_filename ) module_relpath = Utils.relpath( module_filename ) return module_filename, module_relpath, module_name elif module_filename.endswith( ".py" ): module_name = Utils.basename( module_filename )[:-3] module_relpath = Utils.relpath( module_filename ) return module_filename, module_relpath, module_name else: return None
def considerFilename(module_filename, module_package): assert module_package is None or \ ( type( module_package ) is str and module_package != "" ) module_filename = Utils.normpath( module_filename ) if Utils.isDir( module_filename ): module_filename = Utils.abspath( module_filename ) module_name = Utils.basename( module_filename ) module_relpath = Utils.relpath( module_filename ) return module_filename, module_relpath, module_name elif module_filename.endswith( ".py" ): module_name = Utils.basename( module_filename )[:-3] module_relpath = Utils.relpath( module_filename ) return module_filename, module_relpath, module_name else: return None
def _consider(self, constraint_collection, module_filename, module_package): assert module_package is None or \ (type(module_package) is str and module_package != "") module_filename = Utils.normpath(module_filename) if Utils.isDir(module_filename): module_name = Utils.basename(module_filename) module_kind = "py" elif module_filename.endswith(".py"): module_name = Utils.basename(module_filename)[:-3] module_kind = "py" elif module_filename.endswith(".so"): module_kind = "shlib" module_name = Utils.basename(module_filename)[:-3] elif module_filename.endswith(".pyd"): module_kind = "shlib" module_name = Utils.basename(module_filename)[:-4] else: module_kind = None module_name = None if module_kind is not None: from nuitka.tree import Recursion decision, reason = Recursion.decideRecursion( module_filename = module_filename, module_name = module_name, module_package = module_package, module_kind = module_kind ) if decision: module_relpath = Utils.relpath(module_filename) imported_module, added_flag = Recursion.recurseTo( module_package = module_package, module_filename = module_filename, module_relpath = module_relpath, module_kind = module_kind, reason = reason ) if added_flag: constraint_collection.signalChange( "new_code", imported_module.getSourceReference(), "Recursed to module." ) return imported_module elif decision is None and module_kind == "py": if module_package is None: module_fullpath = module_name else: module_fullpath = module_package + "." + module_name if module_filename not in self._warned_about and \ module_fullpath not in getModuleWhiteList(): self._warned_about.add(module_filename) warning( """\ Not recursing to '%(full_path)s' (%(filename)s), please specify \ --recurse-none (do not warn), \ --recurse-all (recurse to all), \ --recurse-not-to=%(full_path)s (ignore it), \ --recurse-to=%(full_path)s (recurse to it) to change.""" % { "full_path" : module_fullpath, "filename" : module_filename } )
def _consider(self, constraint_collection, module_filename, module_package): assert module_package is None or \ (type(module_package) is str and module_package != "") module_filename = Utils.normpath(module_filename) if Utils.isDir(module_filename): module_name = Utils.basename(module_filename) module_kind = "py" elif module_filename.endswith(".py"): module_name = Utils.basename(module_filename)[:-3] module_kind = "py" elif module_filename.endswith(".so"): module_kind = "shlib" module_name = Utils.basename(module_filename)[:-3] elif module_filename.endswith(".pyd"): module_kind = "shlib" module_name = Utils.basename(module_filename)[:-4] else: module_kind = None module_name = None if module_kind is not None: from nuitka.tree import Recursion decision, reason = Recursion.decideRecursion( module_filename=module_filename, module_name=module_name, module_package=module_package, module_kind=module_kind) if decision: module_relpath = Utils.relpath(module_filename) imported_module, added_flag = Recursion.recurseTo( module_package=module_package, module_filename=module_filename, module_relpath=module_relpath, module_kind=module_kind, reason=reason) if added_flag: constraint_collection.signalChange( "new_code", imported_module.getSourceReference(), "Recursed to module.") return imported_module elif decision is None and module_kind == "py": if module_package is None: module_fullpath = module_name else: module_fullpath = module_package + "." + module_name if module_filename not in self._warned_about: self._warned_about.add(module_filename) warning("""\ Not recursing to '%(full_path)s' (%(filename)s), please specify \ --recurse-none (do not warn), \ --recurse-all (recurse to all), \ --recurse-not-to=%(full_path)s (ignore it), \ --recurse-to=%(full_path)s (recurse to it) to change.""" % { "full_path": module_fullpath, "filename": module_filename })