Back to index

python3.2  3.2.2
Public Member Functions
importlib._bootstrap._SourcelessFileLoader Class Reference
Inheritance diagram for importlib._bootstrap._SourcelessFileLoader:
Inheritance graph
[legend]
Collaboration diagram for importlib._bootstrap._SourcelessFileLoader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def load_module
def get_code
def get_source
def get_filename
def get_data
def is_package

Detailed Description

Loader which handles sourceless file imports.

Definition at line 506 of file _bootstrap.py.


Member Function Documentation

Definition at line 513 of file _bootstrap.py.

00513 
00514     def get_code(self, fullname):
00515         path = self.get_filename(fullname)
00516         data = self.get_data(path)
00517         bytes_data = self._bytes_from_bytecode(fullname, data, None)
00518         found = marshal.loads(bytes_data)
00519         if isinstance(found, code_type):
00520             return found
00521         else:
00522             raise ImportError("Non-code object in {}".format(path))

Here is the call graph for this function:

Here is the caller graph for this function:

def importlib._bootstrap._FileLoader.get_data (   self,
  path 
) [inherited]
Return the data from path as raw bytes.

Definition at line 455 of file _bootstrap.py.

00455 
00456     def get_data(self, path):
00457         """Return the data from path as raw bytes."""
00458         with _io.FileIO(path, 'r') as file:
00459             return file.read()
00460 

Here is the caller graph for this function:

def importlib._bootstrap._FileLoader.get_filename (   self,
  fullname 
) [inherited]
Return the path to the source file as found by the finder.

Definition at line 451 of file _bootstrap.py.

00451 
00452     def get_filename(self, fullname):
00453         """Return the path to the source file as found by the finder."""
00454         return self._path

Here is the caller graph for this function:

Return None as there is no source code.

Definition at line 523 of file _bootstrap.py.

00523 
00524     def get_source(self, fullname):
00525         """Return None as there is no source code."""
00526         return None
00527 

Here is the caller graph for this function:

def importlib._bootstrap._LoaderBasics.is_package (   self,
  fullname 
) [inherited]
Concrete implementation of InspectLoader.is_package by checking if
the path returned by get_filename has a filename of '__init__.py'.

Reimplemented in importlib.test.source.test_abc_loader.PyPycLoaderMock, importlib.abc.PyLoader, and importlib.test.source.test_abc_loader.PyLoaderMock.

Definition at line 299 of file _bootstrap.py.

00299 
00300     def is_package(self, fullname):
00301         """Concrete implementation of InspectLoader.is_package by checking if
00302         the path returned by get_filename has a filename of '__init__.py'."""
00303         filename = self.get_filename(fullname).rpartition(path_sep)[2]
00304         return filename.rsplit('.', 1)[0] == '__init__'

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 510 of file _bootstrap.py.

00510 
00511     def load_module(self, fullname):
00512         return self._load_module(fullname, sourceless=True)

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: