예제 #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
예제 #2
0
파일: index.py 프로젝트: jadonk/debexpo
    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')
예제 #3
0
파일: index.py 프로젝트: certik/debexpo
    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')
예제 #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')
예제 #5
0
파일: soap.py 프로젝트: certik/debexpo
    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