Example #1
0
    def fetch_interval_display(self, obj):

        if obj.closed:
            return u'—'

        with django_language():
            return naturaldelta(obj.fetch_interval)
Example #2
0
    def latest_article_display(self, obj):

        if obj.closed:
            return u'—'

        with django_language():
            return naturaltime(obj.latest_article_date_published)
Example #3
0
File: feed.py Project: 1flow/1flow
    def latest_item_display(self, obj):
        """ FILL ME, pep257. """

        if obj.is_active:
            with django_language():
                return naturaltime(obj.latest_item_date_published)

        return u'—'
Example #4
0
    def latest_item_display(self, obj):
        """ FILL ME, pep257. """

        if obj.is_active:
            with django_language():
                return naturaltime(obj.latest_item_date_published)

        return u'—'
Example #5
0
    def latest_article_display(self, obj):
        """ FILL ME, pep257. """

        if obj.closed:
            return u'—'

        with django_language():
            return naturaltime(obj.latest_article_date_published)
Example #6
0
File: feed.py Project: 1flow/1flow
    def fetch_interval_display(self, obj):
        """ FILL ME, pep257. """

        if obj.is_active:
            with django_language():
                return naturaldelta(obj.fetch_interval)

        return u'—'
Example #7
0
    def fetch_interval_display(self, obj):
        """ FILL ME, pep257. """

        if obj.closed:
            return u'—'

        with django_language():
            return naturaldelta(obj.fetch_interval)
Example #8
0
    def gri_executed_display(self, obj):

        gri = GoogleReaderImport(obj.id)

        with django_language():
            if gri.running() is None:
                return u'—'

            else:
                return naturaltime(gri.start())
Example #9
0
    def last_fetch_display(self, obj):

        if obj.closed:
            return u'—'

        if obj.last_fetch is None:
            return _(u'never')

        with django_language():
            return naturaltime(obj.last_fetch)
Example #10
0
    def gri_eta_display(self, obj):

        gri = GoogleReaderImport(obj.id)

        eta = gri.eta()

        if eta:
            with django_language():
                return naturaldelta(eta)

        return u'—'
Example #11
0
    def last_fetch_display(self, obj):
        """ FILL ME, pep257. """

        if obj.closed:
            return u'—'

        if obj.last_fetch is None:
            return _(u'never')

        with django_language():
            return naturaltime(obj.last_fetch)
Example #12
0
File: feed.py Project: 1flow/1flow
    def date_last_fetch_display(self, obj):
        """ FILL ME, pep257. """

        if obj.is_active:

            if obj.date_last_fetch is None:
                return _(u'never')

            with django_language():
                return naturaltime(obj.date_last_fetch)

        return u'—'
Example #13
0
    def date_last_fetch_display(self, obj):
        """ FILL ME, pep257. """

        if obj.is_active:

            if obj.date_last_fetch is None:
                return _(u'never')

            with django_language():
                return naturaltime(obj.date_last_fetch)

        return u'—'
Example #14
0
    def gri_duration_display(self, obj):

        gri = GoogleReaderImport(obj.id)

        with django_language():
            if gri.running():
                return naturaldelta(now() - gri.start())

            elif gri.running() is False:
                return naturaldelta(gri.end() - gri.start())

            else:
                return u'—'
Example #15
0
    def errors_display(self, obj):

        if obj.closed:
            return u'—'

        if obj.errors:
            last3 = [z.rsplit('@@', 1) for z in obj.errors[:3]]

            with django_language():
                return _(u'<span title="Last 3 errors:\n{0}" '
                         u'style="cursor: pointer">'
                         u'{1} error(s)</span>').format(u'\n'.join(
                                _(u'{0}: {1}').format(naturaltime(
                                    dateutil.parser.parse(y)), x)
                                for x, y in last3), len(obj.errors))

        return u'—'
Example #16
0
    def errors_display(self, obj):
        """ FILL ME, pep257. """

        if obj.errors:
            errors = obj.errors
            last3 = [z.rsplit('@@', 1) for z in errors[:3]]

            with django_language():
                return _(u'<span title="Last 3 errors:\n{0}" '
                         u'style="cursor: pointer">'
                         u'{1} error(s)</span>').format(
                             u'\n'.join(
                                 _(u'{0}: {1}').format(
                                     naturaltime(dateutil.parser.parse(y)), x)
                                 for x, y in last3), len(errors))

        return u'—'
Example #17
0
File: feed.py Project: 1flow/1flow
    def date_created_display(self, obj):
        """ FILL ME, pep257. """

        with django_language():
            return naturaltime(obj.date_created)
Example #18
0
    def date_added_display(self, obj):
        """ FILL ME, pep257. """

        with django_language():
            return naturaltime(obj.date_added)
Example #19
0
def naturaldelta(*args, **kwargs):
    """ Wrap `humanize.naturaldelta` into django_language(). """

    with django_language():
        return humanize_time.naturaldelta(*args, **kwargs)
Example #20
0
def naturaldelta(*args, **kwargs):

    with django_language():
        return humanize_time.naturaldelta(*args, **kwargs)
Example #21
0
    def date_added_display(self, obj):

        with django_language():
            return naturaltime(obj.date_added)
Example #22
0
File: base.py Project: 1flow/1flow
    def date_published_delta(self):

        with django_language():
            return _(u'{0} ago').format(naturaldelta(self.date_published))
Example #23
0
    def date_published_delta(self):

        with django_language():
            return _(u'{0} ago').format(naturaldelta(self.date_published))
Example #24
0
def naturaldelta(*args, **kwargs):
    """ Wrap `humanize.naturaldelta` into django_language(). """

    with django_language():
        return humanize_time.naturaldelta(*args, **kwargs)