Part of lp.codehosting.codeimport.worker View In Hierarchy
Import workers can store and retreive files into and from the store using
put()
and fetch()
.
So this store can find files stored by previous versions of this code, the
files are stored at <BRANCH ID IN HEX>.<EXT> where BRANCH ID comes
from the CodeImportSourceDetails used to construct the instance and EXT
comes from the local name passed to put
or fetch
.
Method | __init__ | Initialize an ImportDataStore . |
Method | fetch | Retrieve filename from the store. |
Method | put | Put filename into the store. |
Method | _getRemoteName | Convert local_name to the name used to store a file. |
ImportDataStore
.Parameters | transport | The transport files will be stored on. |
source_details | The CodeImportSourceDetails object, used to
know where to store files on the remote transport. |
local_name
to the name used to store a file.
The algorithm is a little stupid for historical reasons: we chop off the extension and stick that on the end of the branch id from the source_details we were constructed with, in hex padded to 8 characters. For example 'tree.tar.gz' might become '0000a23d.tar.gz' or 'git.db' might become '00003e4.db'.
Parameters | local_name | The local name of the file to be stored. |
Returns | The name to store the file as on the remote transport. |
filename
from the store.Parameters | filename | The name of the file to retrieve (must be a filename, not a path). |
dest_transport | The transport to retrieve the file to, defaulting to get_transport_from_path('.'). | |
Returns | A boolean, true if the file was found and retrieved, false otherwise. |