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

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


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


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


Overwrite in subclasses


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

classmethod worksInStreaming()[source]