コード例 #1
0
    def register_query_bugs(cls):
        path = cls.register_query(
            'query_bugs',
            cls.query_bugs,
            cache_prompt=None,  #cls.cache_prompt,
            primary_key_col='id',
            default_sort_col='date',
            default_sort_order=-1,
            can_paginate=True)

        path.register_column('id',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('status',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('description',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('release',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('package', [], allow_none=False)
        f.add_filter('collection', [], allow_none=False)
        f.add_filter('version', [], allow_none=False)
        cls._query_bugs_filter = f
コード例 #2
0
    def register_query_conflicts(cls):
        path = cls.register_query(
                      'query_conflicts',
                      cls.query_conflicts,
                      primary_key_col = 'name',
                      default_sort_col = 'name',
                      default_sort_order = -1,
                      can_paginate = True)

        path.register_column('name',
                        default_visible = True,
                        can_sort = True,
                        can_filter_wildcards = False)

        path.register_column('flags',
                        default_visible = False,
                        can_sort = False,
                        can_filter_wildcards = False)

        path.register_column('version',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('ops',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)

        f = ParamFilter()
        f.add_filter('package',[], allow_none = False)
        f.add_filter('version',[], allow_none = False)
        f.add_filter('repo',[], allow_none = False)
        f.add_filter('arch',[], allow_none = False)
        cls._query_conflicts_filter = f
コード例 #3
0
    def register_query_changelogs(cls):
        path = cls.register_query('query_changelogs',
                                  cls.query_changelogs,
                                  primary_key_col='id',
                                  default_sort_col='date',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('id',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('date',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('author',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('text',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('build_id', [], allow_none=False)
        cls._query_changelogs_filter = f

        cls._changelog_version_extract_re = re.compile(
            '(.*)\W*<(.*)>\W*-?\W*(.*)')
コード例 #4
0
    def register_query_obsoletes(cls):
        path = cls.register_query('query_obsoletes',
                                  cls.query_obsoletes,
                                  primary_key_col='name',
                                  default_sort_col='name',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('name',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('flags',
                             default_visible=False,
                             can_sort=False,
                             can_filter_wildcards=False)

        path.register_column('version',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        path.register_column('ops',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('nvr', list(), allow_none=False)
        f.add_filter('arch', list(), allow_none=False)
        cls._query_obsoletes_filter = f
コード例 #5
0
    def register_query_problems(cls):
        path = cls.register_query('query_problems',
                                  cls.query_problems,
                                  cache_prompt=None,
                                  primary_key_col='id',
                                  default_sort_col='count',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('id',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('status',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('crash_function',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=True)

        path.register_column('count',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('package_name', list(), allow_none=False)
        cls._query_problems_filter = f
コード例 #6
0
    def register_query_userinfo(cls):
        cls.register_query('query_userinfo',
                           cls.query_userinfo,
                           can_paginate=False)

        f = ParamFilter()
        f.add_filter('username', ['u', 'user', 'name'], allow_none=False)
        f.add_filter('profile', list(), allow_none=True)
        cls._query_userinfo_filter = f
コード例 #7
0
    def register_query_builds(cls):
        path = cls.register_query('query_builds',
                                  cls.query_builds,
                                  cls.query_builds_cache_prompt,
                                  primary_key_col='build_id',
                                  default_sort_col='build_id',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('build_id',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('nvr',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('owner_name',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('state',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        def _profile_user(conn, filter_dict, key, value, allow_none):
            d = filter_dict

            if value:
                user = None

                ident = conn._environ.get('repoze.who.identity')
                if ident:
                    user = ident.get('repoze.who.userid')

                if user or allow_none:
                    d['user'] = user

        f = ParamFilter()
        f.add_filter('user', ['u', 'username', 'name'], allow_none=False)
        f.add_filter('profile',
                     list(),
                     allow_none=False,
                     filter_func=_profile_user,
                     cast=bool)
        f.add_filter('package', ['p'], allow_none=True)
        f.add_filter('state', ['s'], allow_none=True)
        f.add_filter('query_updates', allow_none=True, cast=bool)
        cls._query_builds_filter = f
コード例 #8
0
    def register_query_packages(cls):
        path = cls.register_query('query_packages',
                                  cls.query_packages,
                                  primary_key_col='id',
                                  default_sort_col='name',
                                  default_sort_order=1,
                                  can_paginate=True)

        path.register_column('id',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        path.register_column('name',
                             default_visible=True,
                             can_sort=True,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('prefix', [], allow_none=False)
        cls._query_packages_filter = f
コード例 #9
0
    def register_query_owners(cls):
        path = cls.register_query('owners',
                                  cls.query_owners,
                                  primary_key_col='release',
                                  default_sort_col='release',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('release',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        path.register_column('username',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        f = ParamFilter()
        f.add_filter('package', ['p', 'pkg'], allow_none=False)

        cls._query_acls_filter = f
コード例 #10
0
    def register_query_people(cls):
        path = cls.register_query('query_people',
                                  cls.query_people,
                                  primary_key_col='username',
                                  default_sort_col='username',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('username',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('human_name',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('prefix', allow_none=False)

        cls._query_people_filter = f
コード例 #11
0
    def register_query_active_releases(cls):
        path = cls.register_query('query_active_releases',
                                  cls.query_active_releases,
                                  primary_key_col='release',
                                  default_sort_col='release',
                                  default_sort_order=-1,
                                  can_paginate=True)
        path.register_column('release',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('stable_version',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('testing_version',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('package', ['nvr'], allow_none=False)
        cls._query_active_releases = f
コード例 #12
0
    def register_query_updates(cls):
        path = cls.register_query('query_updates',
                                  cls.query_updates,
                                  primary_key_col='request_id',
                                  default_sort_col='request_id',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('request_id',
                             default_visible=False,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('updateid',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('nvr',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('submitter',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('status',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('request',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('karma',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('nagged',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('type',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('approved',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('date_submitted',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('date_pushed',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('date_modified',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('comments',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('bugs',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('builds',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('releases',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('release',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('karma_level',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        def _profile_user(conn, filter_dict, key, value, allow_none):
            if value:
                user = None
                ident = conn._environ.get('repoze.who.identity')
                if ident:
                    user = ident.get('repoze.who.userid')
                if user or allow_none:
                    filter_dict['username'] = user

        f = ParamFilter()
        f.add_filter('package', ['nvr'], allow_none=False)
        f.add_filter('user', ['u', 'username', 'name'], allow_none=False)
        f.add_filter('profile', [],
                     allow_none=False,
                     filter_func=_profile_user,
                     cast=bool)
        f.add_filter('status', ['status'], allow_none=True)
        f.add_filter('group_updates', allow_none=True, cast=bool)
        f.add_filter('granularity', allow_none=True)
        f.add_filter('release', allow_none=False)
        cls._query_updates_filter = f
コード例 #13
0
    def register_query_updates(cls):
        path = cls.register_query('query_updates',
                                  cls.query_updates,
                                  cls.query_updates_cache_prompt,
                                  primary_key_col='request_id',
                                  default_sort_col='request_id',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('request_id',
                             default_visible=False,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('updateid',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('nvr',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('submitter',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('status',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('request',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('karma',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('nagged',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('type',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('approved',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('date_submitted',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('date_pushed',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('date_modified',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('comments',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('bugs',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('builds',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('releases',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('release',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('karma_level',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)

        f = ParamFilter()
        f.add_filter('package', ['nvr'], allow_none=False)
        f.add_filter('status', ['status'], allow_none=True)
        f.add_filter('group_updates', allow_none=True, cast=bool)
        f.add_filter('granularity', allow_none=True)
        f.add_filter('release', allow_none=False)
        cls._query_updates_filter = f
コード例 #14
0
    def register_query_userpackages(cls):
        path = cls.register_query('query_userpackages',
                                  cls.query_userpackages,
                                  primary_key_col='id',
                                  default_sort_col='name',
                                  default_sort_order=-1,
                                  can_paginate=True)

        path.register_column('id',
                             default_visible=False,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('name',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('summary',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('description',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('reviewurl',
                             default_visible=False,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('shouldopen',
                             default_visible=False,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('statuscode',
                             default_visible=True,
                             can_sort=False,
                             can_filter_wildcards=False)
        path.register_column('collections',
                             default_visible=False,
                             can_sort=False,
                             can_filter_wildcards=False)

        def filter_acls(conn, d, k, v, allow_none):
            acls = []
            if 'acls' in d:
                acls = d['acls']

            acls.append(k)
            d['acls'] = acls

        f = ParamFilter()
        f.add_filter('fasname', ['u', 'user', 'name', 'username'],
                     allow_none=False)
        f.add_filter('owner', ['o'],
                     cast=bool,
                     allow_none=False,
                     filter_func=filter_acls)
        f.add_filter('maintainer', ['m', 'commit'],
                     cast=bool,
                     allow_none=False,
                     filter_func=filter_acls)
        f.add_filter('approveacls', ['a', 'acls'],
                     cast=bool,
                     allow_none=False,
                     filter_func=filter_acls)
        f.add_filter('watchcommits', ['wc'],
                     cast=bool,
                     allow_none=False,
                     filter_func=filter_acls)
        f.add_filter('watchbugzilla', ['wb', 'bugs'],
                     cast=bool,
                     allow_none=False,
                     filter_func=filter_acls)
        f.add_filter('eol', [], cast=bool)

        cls._query_userpackages_filter = f
コード例 #15
0
    def register_query_usermemberships(cls):
        path = cls.register_query(
                      'query_usermemberships',
                      cls.query_usermemberships,
                      primary_key_col = 'id',
                      default_sort_col = 'name',
                      default_sort_order = -1,
                      can_paginate = True)

        path.register_column('id',
                        default_visible = False,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('name',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('display_name',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('group_type',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('irc_channel',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('irc_network',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('joinmsg',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('mailing_list',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('mailing_list_url',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('needs_sponsor',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('owner_id',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('prerequisite_id',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False),
        path.register_column('url',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('user_can_remove',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('apply_rules',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)
        path.register_column('creation',
                        default_visible = True,
                        can_sort = False,
                        can_filter_wildcards = False)

        f = ParamFilter()
        f.add_filter('username',['u', 'user', 'name'], allow_none = False)
        f.add_filter('profile',[], allow_none=True)
        f.add_filter('show_approved',['approved', 'a'], allow_none = True)
        f.add_filter('show_unapproved',['unapproved', 'un'], allow_none = True)
        cls._query_usermemberships_filter = f