-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In addition to the `docker cp` and `scp` methods already available, this commit includes the ability to access files like sample data when it's simply available in the local filesystem.
- Loading branch information
Showing
5 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Archivematica LocalFS Ability | ||
This module contains the ``ArchivematicaLocalFSAbility`` class, which encodes | ||
the ability to transfer files when they're locally available. | ||
""" | ||
|
||
import logging | ||
import os | ||
|
||
from . import base | ||
|
||
|
||
logger = logging.getLogger('amuser.localfs') | ||
|
||
|
||
class ArchivematicaLocalFSAbility(base.Base): | ||
"""Archivematica LocalFS Ability: the ability of an Archivematica user to | ||
access files in the application environment when they're local. | ||
""" | ||
|
||
def read_server_file(self, server_file_path): | ||
"""Return the local path to the file/dir requested. | ||
If needed in the future, it should be possible to have a map of | ||
transformations provided by the user running ``behave`` when the | ||
assets are available in different lcoations, e.g.: | ||
>>> for prefix, replacement in self.local_dirs_mapping: | ||
>>> if server_file_path.startswith(prefix): | ||
>>> return os.path.join( | ||
>>> replacement, server_file_path[ | ||
>>> len(prefix):].lstrip("/")) | ||
>>> return server_file_path | ||
""" | ||
return server_file_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters