class DownloadFromEmail(BaseSubstitution): """ Download from name """ category = _(u'Download') description = _(u'Download from email') def safe_call(self): """ Safe call """ return getattr(self.wrapper, 'from_email', '')
class DownloadType(BaseSubstitution): """ Download from name """ category = _(u'Download') description = _(u'Download type') def safe_call(self): """ Safe call """ return getattr(self.wrapper, 'etype', 'pdf').upper()
class DownloadTitle(BaseSubstitution): """ Download title substitution """ category = _(u'Download') description = _(u'Download title') def safe_call(self): """ Safe call """ return getattr(self.wrapper, 'title', '')
class DownloadError(BaseSubstitution): """ Download error """ category = _(u'Download') description = _(u'Download error') def safe_call(self): """ Safe call """ return getattr(self.wrapper, 'error', '')
class DownloadCameFromUrl(BaseSubstitution): """ Download email substitution """ category = _(u'Download') description = _(u'Download came from URL') def safe_call(self): """ Safe call """ return getattr(self.wrapper, 'url', '')
class DownloadEmail(BaseSubstitution): """ Download email substitution """ category = _(u'Download') description = _(u'Download e-mail') def safe_call(self): """ Safe call """ return getattr(self.wrapper, 'email', '')
class IAsyncJob(Interface): """ Asynchronous job """ toclean = schema.List( title=_(u"List of absolute file paths on disk to be cleaned up"), value_type=schema.TextLine(title=_(u"Absolute file path on disk"))) path = schema.TextLine(title=_(u"Output file path on disk")) dependencies = schema.List( title=_(u"List of jobs to be ran as dependencies to this job"), value_type=schema.Object(title=_(u"IAsyncJob job"), schema=Interface)) def cleanup(): """ Cleanup temporary files on disk """ def run(): """ Run job
def header(self): """ Header """ contents_translate = _(u"Contents") return contents_translate