patch from Paul Moore

This commit is contained in:
David Goodger 2006-02-24 22:47:18 +00:00
parent f242f9b082
commit f7ec3048fd
1 changed files with 7 additions and 5 deletions

View File

@ -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