patch from Paul Moore
This commit is contained in:
parent
f242f9b082
commit
f7ec3048fd
12
pep-0302.txt
12
pep-0302.txt
|
@ -365,13 +365,15 @@ Optional Extensions to the Importer Protocol
|
|||
loader.get_data(path)
|
||||
|
||||
This method returns the data as a string, or raise IOError if the
|
||||
"file" wasn't found. It is meant for importers that have some
|
||||
file-system-like properties. The 'path' argument is a path that can
|
||||
be constructed by munging module.__file__ (or pkg.__path__ items)
|
||||
with the os.path.* functions, for example:
|
||||
"file" wasn't found. The data is always returned as if "binary" mode
|
||||
was used - there is no CRLF translation of text files, for example.
|
||||
It is meant for importers that have some file-system-like properties.
|
||||
The 'path' argument is a path that can be constructed by munging
|
||||
module.__file__ (or pkg.__path__ items) with the os.path.* functions,
|
||||
for example:
|
||||
|
||||
d = os.path.dirname(__file__)
|
||||
data = __loader__.get_data(os.path.join(d, "mydata.txt"))
|
||||
data = __loader__.get_data(os.path.join(d, "logo.gif"))
|
||||
|
||||
The following set of methods may be implemented if support for (for
|
||||
example) Freeze-like tools is desirable. It consists of three
|
||||
|
|
Loading…
Reference in New Issue