def period(self): """ Wait period """ ptype = getattr(self.context, 'portal_type', '') if ptype.lower() in ('collection', 'topic', 'folder', 'atfolder'): return _(u"minutes") return _(u"seconds")
def period(self): """ Wait period """ ptype = getattr(self.context, "portal_type", "") if ptype.lower() in ("collection", "topic", "folder", "atfolder"): return _(u"minutes") return _(u"seconds")
class IExtraSettings(model.Schema): """ Extra settings """ epub = schema.Bool(title=_(u"ePub"), description=_(u"Invalidate latest generated ePub file"), required=False, default=False)
def finish(self, email=""): """ Finish download """ if email: self._email = email self._title = _(u"An email will be sent to you when the ePub is ready") self._message = _( u"If you don't have access to your email address " u"check <a href='${link}'>this link</a> in a few ${period}.", mapping={u"link": u"%s?direct=1" % self.link(), u"period": self.period()}, ) return self._redirect()
def finish(self, email=''): """ Finish download """ if email: self._email = email self._title = _( u"An email will be sent to you when the ePub is ready") self._message = _( u"If you don't have access to your email address " u"check <a href='${link}'>this link</a> in a few ${period}.", mapping={ u"link": u"%s?direct=1" % self.link(), u"period": self.period() }) return self._redirect()
def __init__(self, context, request): super(AsyncExportView, self).__init__(context, request) self._title = "" self._message = _( u"* The email is only used for the purpose of sending the ePub. " u"We do not store it for any other use." ) self._email = "" self._link = ""
def __init__(self, context, request): super(AsyncExportView, self).__init__(context, request) self._title = '' self._message = _( u"* The email is only used for the purpose of sending the ePub. " u"We do not store it for any other use.") self._email = '' self._link = ''
def title(self): """ Title """ if self._title: return self._title title = self.context.title_or_id() if isinstance(title, str): title = title.decode("utf-8") return _(u"Enter your email address where to send '${title}' ePub when ready", mapping={"title": title})
def title(self): """ Title """ if self._title: return self._title title = self.context.title_or_id() if isinstance(title, str): title = title.decode('utf-8') return _( u"Enter your email address where to send '${title}' ePub when ready", mapping={'title': title})