owmeta_core.data_trans.local_file_ds module

class owmeta_core.data_trans.local_file_ds.CommitOp(value)[source]

Bases: Enum

Indicates which operation to perform for “commiting” a local file. See LocalFileDataSource.

COPY = 2

copy the source file contents to the target file

create a hard-link to the file. This will not be valid in case the source and target file are on different file systems.

RENAME = 1

rename the source file to the target file

create a symbolic link to the file. This may not be allowed for unprivileged users on Windows machines

class owmeta_core.data_trans.local_file_ds.LocalFileDataSource(*args, no_type_decl=False, **kwargs)[source]

Bases: CapableConfigurable, FileDataSource

File paths should be relative – in general, path names on a given machine are not portable

Attributes
commit_opCommitOp

The operation to use for commiting the file changes

Parameters
commit_opCommitOp, optional

The operation to use for commiting the file changes. The default is COPY

after_transform()[source]

“Commits” the file by applying the operation indicated by commit_op to source_file_path so that it is accessible at full_path

file_contents()[source]

Returns an open file to be read from at <full_path>/<file_name>

This file should be closed when you are done with it. It may be used as a context manager

file_output()[source]

Returns an open file to be written to at <full_path>/<file_name>

This file should be closed when you are done with it. It may be used as a context manager

full_output_path()[source]

Returns the full output path to the file

full_path()[source]

Returns the full path to the file

file_name

“File name”, a DatatypeProperty

torrent_file_name

“Torrent file name”, a DatatypeProperty