Пример #1
0
def packager_info(packager):
    ''' Display the information about the specified packager. '''

    packages_co = pkgdblib.get_package_maintained(
        SESSION,
        packager=packager,
        poc=False,
    )

    packages = pkgdblib.get_package_maintained(
        SESSION,
        packager=packager,
        poc=True,
    )

    if not packages and not packages_co:
        flask.flash('No packager of this name found.', 'errors')
        return flask.render_template('msg.html')

    return flask.render_template(
        'packager.html',
        packager=packager,
        packages=packages,
        packages_co=packages_co,
    )
Пример #2
0
    def test_get_package_maintained(self):
        """ Test the get_package_maintained function. """
        create_package_acl(self.session)

        pkg = pkgdblib.get_package_maintained(self.session, 'pingou')
        self.assertEqual(len(pkg), 1)
        self.assertEqual(pkg[0].name, 'guake')

        pkg = pkgdblib.get_package_maintained(self.session, 'ralph')
        self.assertEqual(pkg, [])
Пример #3
0
    def test_get_package_maintained(self):
        """ Test the get_package_maintained function. """
        create_package_acl(self.session)

        pkg = pkgdblib.get_package_maintained(self.session, 'pingou')
        self.assertEqual(len(pkg), 1)
        self.assertEqual(pkg[0].name, 'guake')

        pkg = pkgdblib.get_package_maintained(self.session, 'ralph')
        self.assertEqual(pkg, [])
Пример #4
0
def packager_info(packager):
    ''' Display the information about the specified packager. '''

    packages = []
    packages_co = []
    try:
        packages_co = pkgdblib.get_package_maintained(
            SESSION,
            packager=packager
        )
    except NoResultFound:
        SESSION.rollback()

    # clean co-maintained packages and split out PoC packages
    cnt = 0
    while cnt < len(packages_co):
        maint = []
        for acls in packages_co[cnt].listings:
            maint.append(acls.point_of_contact)
        if packager in maint:
            packages.append(packages_co[cnt])
            del(packages_co[cnt])
            cnt -= 1
        cnt += 1

    if not packages and not packages_co:
        flask.flash('No packager of this name found.', 'errors')
        return flask.render_template('msg.html')

    return flask.render_template(
        'packager.html',
        packager=packager,
        packages=packages,
        packages_co=packages_co,
    )
Пример #5
0
def packager_info(packager):
    ''' Display the information about the specified packager. '''

    packages = []
    packages_co = []
    try:
        packages_co = pkgdblib.get_package_maintained(SESSION,
                                                      packager=packager)
    except NoResultFound:
        SESSION.rollback()

    # clean co-maintained packages and split out PoC packages
    cnt = 0
    while cnt < len(packages_co):
        maint = []
        for acls in packages_co[cnt].listings:
            maint.append(acls.point_of_contact)
        if packager in maint:
            packages.append(packages_co[cnt])
            del (packages_co[cnt])
            cnt -= 1
        cnt += 1

    if not packages and not packages_co:
        flask.flash('No packager of this name found.', 'errors')
        return flask.render_template('msg.html')

    return flask.render_template(
        'packager.html',
        packager=packager,
        packages=packages,
        packages_co=packages_co,
    )