Ejemplo n.º 1
0
    def _get_packages(self,
                      package_filter=None,
                      package_version_filter=None,
                      email=None):
        """
        Helper method to construct the list for package information.
        """
        pkg_ctl = PackagesController()

        if email is not None:
            user = pkg_ctl._get_user(email)
            if user is None:
                log.error('Could not find user; returning empty list')
                return []
            package_filter = (Package.user_id == user.id)

        packages = pkg_ctl._get_packages(
            package_filter=package_filter,
            package_version_filter=package_version_filter)

        out = []
        for item in packages:
            out.append([
                item.name, item.package_versions[-1].version,
                '%s <%s>' % (item.user.name, item.user.email),
                item.description, config['debexpo.server'] +
                url('package', packagename=item.name)
            ])

        return out
Ejemplo n.º 2
0
    def index(self):
        pkg_controller = PackagesController()

        c.config = config
        c.packages = pkg_controller._get_packages(
		        package_version_filter=(PackageVersion.uploaded >= (datetime.today() - timedelta(days=30))),
		        package_filter=(Package.needs_sponsor == 1)
            )
        c.deltas = pkg_controller._get_timedeltas(c.packages)
        c.deltas.pop()
	return render('/index/index.mako')
Ejemplo n.º 3
0
    def index(self):
        pkg_controller = PackagesController()

        if 'debexpo.html.frontpage' in config:
            f = open(config['debexpo.html.frontpage'])
            c.custom_html = f.read()
            f.close()
        else:
            c.custom_html = ''

        c.config = config
        c.packages = pkg_controller._get_packages()
        return render('/index/index.mako')
Ejemplo n.º 4
0
    def index(self):
        pkg_controller = PackagesController()

        if 'debexpo.html.frontpage' in config:
            f = open(config['debexpo.html.frontpage'])
            c.custom_html = f.read()
            f.close()
        else:
            c.custom_html = ''

        c.config = config
        c.packages = pkg_controller._get_packages()
        return render('/index/index.mako')
Ejemplo n.º 5
0
    def _get_packages(self, package_filter=None, package_version_filter=None, email=None):
        """
        Helper method to construct the list for package information.
        """
        pkg_ctl = PackagesController()

        if email is not None:
            user = pkg_ctl._get_user(email)
            if user is None:
                log.error('Could not find user; returning empty list')
                return []
            package_filter = (Package.user_id == user.id)

        packages = pkg_ctl._get_packages(package_filter=package_filter,
            package_version_filter=package_version_filter)

        out = []
        for item in packages:
            out.append([item.name, item.package_versions[-1].version,
                '%s <%s>' % (item.user.name, item.user.email),
                item.description,
                config['debexpo.server'] + h.url_for('package', packagename=item.name)])

        return out