pwem.protocols.protocol_import.base module

class pwem.protocols.protocol_import.base.ProtImport(**kwargs)[source]

Bases: EMProtocol

Base class for other all Import protocols.

class pwem.protocols.protocol_import.base.ProtImportFiles(**kwargs)[source]

Bases: ProtImport

Base class for other Import protocols. All imports protocols will have: 1) Several options to import from (_getImportOptions function) 2) First option will always be “from files”. (for this option

files with a given pattern will be retrieved and the ### will be used to mark an ID part from the filename. - For each file a function to process it will be called

(_importFile(fileName, fileId))

IMPORT_FROM_FILES = 0
fileModified(fileName, fileTimeout)[source]

Check if the fileName modification time is less than a given timeout. Params:

fileName: input filename that will be checked. fileTimeout: timeout

getMatchFiles(pattern=None)[source]

Return a sorted list with the paths of files that matched the pattern.

getPattern()[source]

Expand the pattern using environ vars or username and also replacing special character # by digit matching.

isBlacklisted(fileName)[source]

Overwrite in subclasses

iterFiles()[source]

Iterate through the files matched with the pattern. Provide the fileName and fileId.

classmethod worksInStreaming()[source]