Esempio n. 1
0
 class Queries( object ):
     default = AllPublicQuery( browsers=( 'normal', ), verbose_name="Stars@ESO", feed_name="default" )
Esempio n. 2
0
 class Queries(object):
     default = AllPublicQuery( browsers=( 'normal', 'viewall' ), verbose_name=view_name )
Esempio n. 3
0
 class Queries(object):
     default = AllPublicQuery( browsers=( 'normal', 'viewall' ), verbose_name="FITS Liberator Images" )
Esempio n. 4
0
 class Queries(object):
     default = AllPublicQuery( browsers=( 'normal', 'viewall' ), verbose_name="Presentations" )
Esempio n. 5
0
 class Queries(object):
     default = AllPublicQuery( browsers=( 'normal', 'viewall' ), verbose_name="Electronic Cards" )
Esempio n. 6
0
 class Queries(object):
     default = AllPublicQuery( browsers=( 'normal', 'viewall' ), verbose_name="Calendars" )
     year = CalendarYearQuery( browsers=( 'normal', 'viewall' ), verbose_name="Calendar: %d")
Esempio n. 7
0
 class Queries( object ):
     default = AllPublicQuery( browsers=( 'normal', 'json', 'ical' ), verbose_name=ugettext_noop("Web Updates"), feed_name="default" )
Esempio n. 8
0
 class Queries( object ):
     default = AllPublicQuery( browsers=( 'normal', 'viewall', 'json', 'ical' ), verbose_name=ugettext_noop("Announcements"), feed_name="default" )
     featured = FeaturedQuery( browsers=( 'normal', 'viewall', 'json', 'ical' ), verbose_name=ugettext_noop("Featured Announcements"), feed_name="default", include_in_urlpatterns=False )
     embargo = EmbargoQuery( browsers=( 'normal', 'viewall', 'json', 'ical' ), verbose_name=ugettext_noop("Embargoed Announcements") )
     staging = StagingQuery( browsers=( 'normal', 'viewall', 'json', 'ical' ), verbose_name=ugettext_noop("Announcements (Staging)") )
     year = YearQuery( browsers=( 'normal', 'viewall' ), verbose_name=ugettext_noop("Announcements %d"), feed_name="default" )
        if not isinstance(getattr(Image.Archive, fmt), ResourceManager):
            raise Exception("Specified format is not a valid resource format.")

        zipfile = "top100-%s.zip" % fmt

        if tmppath and not os.path.exists(tmppath):
            raise Exception("Temporary directory %s does not exists." %
                            tmppath)

        if not os.path.exists(outputdir):
            raise Exception("Output directory %s does not exists." % outputdir)

        outputfile = os.path.join(outputdir, zipfile)

        # Query for images.
        ims = AllPublicQuery(browsers=[None]).queryset(
            Image, ImageOptions, None)[0].filter(published=True)[:100]

        # Create temporary directory
        tmppath = tempfile.mkdtemp(dir=tmppath)
        tmppath100 = os.path.join(tmppath, "top100")
        os.makedirs(tmppath100)

        # Copy images into temporary directory
        copyfiles = []
        totalsize = 0
        for im in ims:
            resource = getattr(im, "resource_%s" % fmt)

            if resource and os.path.exists(resource.path):
                (impath, imfile) = os.path.split(resource.path)
                copyfiles.append(