16 | ${w.upstream_tarball}
17 | % else:
18 | No upstream tarball found
19 | % endif
20 |
21 |
22 | % if w.fedora_tarball:
23 |
Fedora Look-aside Tarball
24 | ${w.fedora_tarball}
25 | % else:
26 | No Fedora tarball found
27 | % endif
28 |
29 |
30 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/package/contents.py:
--------------------------------------------------------------------------------
1 | import tw2.core as twc
2 |
3 | from fedoracommunity.widgets.tree import tree_js
4 |
5 | class FilelistTree(twc.Widget):
6 | template='mako:fedoracommunity.widgets.package.templates.filelist_tree_widget'
7 |
8 | def prepare(self):
9 | super(FilelistTree, self).prepare()
10 |
11 |
12 | class ContentsWidget(twc.Widget):
13 | resources = [tree_js]
14 | template = 'mako:fedoracommunity.widgets.package.templates.contents'
15 | # filelist_tree = FilelistTree
16 |
17 | def prepare(self):
18 | super(ContentsWidget, self).prepare()
19 |
20 | self.package_name = self.kwds['package_name']
21 | self.subpackage_of = self.kwds.get('subpackage_of', '')
22 |
23 | # TODO - get these from from the 'active releases' connector.
24 | self.repos = ['rawhide']
25 |
--------------------------------------------------------------------------------
/setup.cfg:
--------------------------------------------------------------------------------
1 | [egg_info]
2 | tag_build =
3 | #tag_svn_revision = true
4 |
5 | [easy_install]
6 | find_links = http://www.pylonshq.com/download/
7 |
8 | [nosetests]
9 | with-pylons=test.ini
10 |
11 | # Babel configuration
12 | [compile_catalog]
13 | domain = myfedora
14 | directory = myfedora/i18n
15 | statistics = true
16 |
17 | [extract_messages]
18 | add_comments = TRANSLATORS:
19 | output_file = myfedora/i18n/myfedora.pot
20 | width = 80
21 |
22 | [init_catalog]
23 | domain = myfedora
24 | input_file = myfedora/i18n/myfedora.pot
25 | output_dir = myfedora/i18n
26 |
27 | [update_catalog]
28 | domain = myfedora
29 | input_file = myfedora/i18n/myfedora.pot
30 | output_dir = myfedora/i18n
31 | previous = true
32 |
33 | [archive_tw_resources]
34 | output = toscawidgets
35 | distributions = fedoracommunity
36 | #compresslevel = 2
37 | onepass = true
38 | #yuicompressor = /home/someuser/bin/yuicompressor.jar
39 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/jquery_template.py:
--------------------------------------------------------------------------------
1 | # This file is part of Moksha.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | import tw2.core as twc
17 | import tw2.jquery
18 |
19 | jquery_template_js = twc.JSLink(
20 | modname=__name__,
21 | filename='static/javascript/jquery.tmpl.js',
22 | resources=[tw2.jquery.jquery_js])
23 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/package/changelog.py:
--------------------------------------------------------------------------------
1 | import tw2.core as twc
2 | from fedoracommunity.widgets.grid import Grid
3 |
4 | class ChangelogGrid(Grid):
5 | template='mako:fedoracommunity.widgets.package.templates.changelog_table_widget'
6 | resource='koji'
7 | resource_path='query_changelogs'
8 |
9 | def prepare(self):
10 |
11 | # TODO - get these from from the 'active releases' connector.
12 | self.all_releases = [
13 | 'rawhide',
14 | ]
15 |
16 | self.filters = {
17 | 'package_name': self.package_name,
18 | 'release': self.all_releases[0],
19 | }
20 | self.rows_per_page = 10
21 |
22 | # Must do this last for our Grids
23 | super(ChangelogGrid, self).prepare()
24 |
25 |
26 | class ChangelogWidget(twc.Widget):
27 | template = 'mako:fedoracommunity.widgets.package.templates.changelog'
28 | changelog_grid = ChangelogGrid
29 |
--------------------------------------------------------------------------------
/fedoracommunity/config/environment.py:
--------------------------------------------------------------------------------
1 | # This file is part of Fedora Community.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU Affero General Public License as
6 | # published by the Free Software Foundation, either version 3 of the
7 | # License, or (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU Affero General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU Affero General Public License
15 | # along with this program. If not, see .
16 |
17 | from fedoracommunity.config.app_cfg import base_config
18 |
19 | load_environment = base_config.make_load_environment()
20 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/package/builds.py:
--------------------------------------------------------------------------------
1 | import tw2.core as twc
2 | from fedoracommunity.widgets.grid import Grid
3 |
4 | class BuildsGrid(Grid):
5 | template='mako:fedoracommunity.widgets.package.templates.builds_table_widget'
6 | resource='koji'
7 | resource_path='query_builds'
8 |
9 | def prepare(self):
10 | self.filters = {'package': self.package_name}
11 | self.rows_per_page = 10
12 |
13 | # Must do this last for our Grids
14 | super(BuildsGrid, self).prepare()
15 |
16 |
17 | class Builds(twc.Widget):
18 | template = 'mako:fedoracommunity.widgets.package.templates.builds'
19 | in_progress_builds = BuildsGrid
20 |
21 | def prepare(self):
22 | super(Builds, self).prepare()
23 | subpackage_of = self.kwds.get('subpackage_of', '')
24 |
25 | if subpackage_of:
26 | self.main_package = subpackage_of
27 | else:
28 | self.main_package = self.kwds['package_name']
29 |
--------------------------------------------------------------------------------
/fedoracommunity/connectors/api/__init__.py:
--------------------------------------------------------------------------------
1 | # This file is part of Moksha.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | from connector import IConnector, ICall, IQuery, IFeed, INotify, ISearch
17 | from utils import ParamFilter
18 |
19 | from mw import _get_connector as get_connector
20 |
21 | __all__ = [IConnector, ICall, IQuery, IFeed, INotify, ISearch, ParamFilter,
22 | get_connector]
23 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/package/templates/provides_table_widget.mak:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
29 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/fedoracommunity/search/distmappings.py:
--------------------------------------------------------------------------------
1 | # Global list of koji tags we care about
2 | tags = ({'name': 'Rawhide', 'tag': 'f21'},
3 |
4 | {'name': 'Fedora 20', 'tag': 'f20-updates'},
5 | {'name': 'Fedora 20', 'tag': 'f20'},
6 | {'name': 'Fedora 20 Testing', 'tag': 'f20-updates-testing'},
7 |
8 | {'name': 'Fedora 19', 'tag': 'f19-updates'},
9 | {'name': 'Fedora 19', 'tag': 'f19'},
10 | {'name': 'Fedora 19 Testing', 'tag': 'f19-updates-testing'},
11 |
12 | {'name': 'Fedora 18', 'tag': 'f18-updates'},
13 | {'name': 'Fedora 18', 'tag': 'f18'},
14 | {'name': 'Fedora 18 Testing', 'tag': 'f18-updates-testing'},
15 |
16 | {'name': 'EPEL 6', 'tag': 'dist-6E-epel'},
17 | {'name': 'EPEL 6 Testing', 'tag': 'dist-6E-epel-testing'},
18 |
19 | {'name': 'EPEL 5', 'tag': 'dist-5E-epel'},
20 | {'name': 'EPEL 5 Testing', 'tag': 'dist-5E-epel-testing'},
21 |
22 | {'name': 'EPEL 7', 'tag': 'epel7'},
23 | {'name': 'EPEL 7 Testing', 'tag': 'epel7-testing'},
24 | )
25 |
26 | tags_to_name_map = {}
27 | for t in tags:
28 | tags_to_name_map[t['tag']] = t['name']
29 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/expander.py:
--------------------------------------------------------------------------------
1 | # This file is part of Fedora Community.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU Affero General Public License as
6 | # published by the Free Software Foundation, either version 3 of the
7 | # License, or (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU Affero General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU Affero General Public License
15 | # along with this program. If not, see .
16 |
17 | """
18 | :mod:`fedoracommunity.widgets.expander` -- An Expander Widget
19 | =============================================================
20 |
21 | http://plugins.learningjquery.com/expander
22 | """
23 |
24 | import tw2.core as twc
25 |
26 | expander_js = twc.JSLink(filename='static/javascript/jquery.expander.js',
27 | modname=__name__)
28 |
--------------------------------------------------------------------------------
/fedoracommunity/lib/app_globals.py:
--------------------------------------------------------------------------------
1 | # This file is part of Fedora Community.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU Affero General Public License as
6 | # published by the Free Software Foundation, either version 3 of the
7 | # License, or (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU Affero General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU Affero General Public License
15 | # along with this program. If not, see .
16 |
17 | """The application's Globals object"""
18 |
19 | from tg import config
20 |
21 | class Globals(object):
22 | """Globals acts as a container for objects available throughout the
23 | life of the application
24 | """
25 |
26 | def __init__(self):
27 | """One instance of Globals is created during application
28 | initialization and is available during requests via the 'g'
29 | variable
30 | """
31 | pass
32 |
--------------------------------------------------------------------------------
/fedoracommunity/plugins/extensions/make_menu.js:
--------------------------------------------------------------------------------
1 | // This file is part of Fedora Community.
2 | // Copyright (C) 2008-2009 Red Hat, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | {
18 | info: {
19 | consumes:['make_menu'],
20 | author: 'John (J5) Palmieri ',
21 | version: '0.1',
22 | name: 'Menu Creator',
23 | summary: 'Async creation of menus used inside of templates',
24 | description: 'Since jQuery templates can\'t have javascript in \
25 | them we use this to create a javascript menu'
26 | },
27 |
28 | run: function (data) {
29 | $('#' + data.placeholder_id).moksha_popup();
30 |
31 | return null;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/devel/docker/packages:
--------------------------------------------------------------------------------
1 | # This image can only be built when it is executed with context
2 | # set to root directory or project checkout.
3 | #
4 | # docker build -f packages ../
5 | #
6 | # `docker-compose build` from parent dir does this automatically.
7 |
8 | FROM registry.fedoraproject.org/fedora:27
9 |
10 | COPY 01packages.txt /root/01packages.txt
11 | RUN dnf install -y $(grep "^[^#]" /root/01packages.txt)
12 | RUN dnf clean all
13 |
14 | RUN mkdir -p /var/log/fedoracommunity\
15 | /var/cache/fedoracommunity/packages/icons\
16 | /var/cache/fedoracommunity/packages/xapian/search\
17 | /var/cache/fedoracommunity/packages/tmp/icons\
18 | /var/cache/fedoracommunity/packages/tmp/search\
19 | /var/cache/fedoracommunity/packages/tmp/var\
20 | /var/tmp/fedoracommunity/icons/tmp\
21 | /usr/share/fedoracommunity \
22 | /tmp/xapian\
23 | #forward error logs to docker log collector
24 | && ln -sf /dev/stdout /var/log/httpd/fedoracommunity_error_log
25 |
26 | EXPOSE 80
27 |
28 | # download and unpack production database
29 | WORKDIR /var/cache/fedoracommunity/packages
30 | RUN curl -O https://cverna.fedorapeople.org/xapian.tar.gz
31 | RUN tar -xvf xapian.tar.gz
32 |
33 | COPY docker/entry-point.sh /root/entry-point.sh
34 | COPY docker/fedora-packages.conf /etc/httpd/conf.d/fedora-packages.conf
35 | COPY docker/development.ini /etc/fedoracommunity/production.ini
36 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/package/templates/required_by_table_widget.mak:
--------------------------------------------------------------------------------
1 | <%
2 | import tg
3 | %>
4 |
5 |
6 |
7 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/tree.py:
--------------------------------------------------------------------------------
1 | # This file is part of Fedora Community.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU Affero General Public License as
6 | # published by the F# This file is part of Fedora Community.
7 | # Copyright (C) 2008-2010 Red Hat, Inc.
8 | #
9 | # This program is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU Affero General Public License as
11 | # published by the Free Software Foundation, either version 3 of the
12 | # License, or (at your option) any later version.
13 | #
14 | # This program is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU Affero General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU Affero General Public License
20 | # along with this program. If not, see .
21 |
22 | """
23 | :mod:`fedoracommunity.widgets.tree` -- wrapper for jquery jstree plugin
24 | =============================================================
25 | """
26 |
27 |
28 | import tw2.core as twc
29 | import tw2.jqplugins.ui
30 |
31 | tree_js = twc.JSLink(filename='static/javascript/jquery.jstree.js',
32 | resources=[tw2.jqplugins.ui.jquery_ui_js],
33 | modname=__name__)
34 |
--------------------------------------------------------------------------------
/fedoracommunity/templates/index.mak:
--------------------------------------------------------------------------------
1 | <%namespace file="fedoracommunity.templates.header" import="*" />
2 | <%namespace file="fedoracommunity.templates.footer" import="*" />
3 | <% from tg import flash %>
4 |
5 |
6 |
7 | ${title}
8 |
9 |
10 |
11 |
14 |
16 |
18 |
19 |
28 |
29 |
30 |
31 |
Found a bug on this website? File a ticket. For bugs in packages, click the "Open a New Bug" link on the packages Bugs page. Note: There's some caching going on here. If you expect something and don't see it, check back in 5 minutes.
6 | This Web Site is licensed under the GNU Affero General Public License. You may get sources for the current running code from these repositories:
7 |
57 | % if w.widget:
58 | ${w.widget.display(args=w.args, kwds=w.kwds) | n }
59 | % else:
60 | Unable to render ${w.active_tab} tab.
61 | % endif
62 |
63 |
64 |
65 |
70 |
71 |
--------------------------------------------------------------------------------
/fedoracommunity/config/middleware.py:
--------------------------------------------------------------------------------
1 | # This file is part of Fedora Community.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU Affero General Public License as
6 | # published by the Free Software Foundation, either version 3 of the
7 | # License, or (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU Affero General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU Affero General Public License
15 | # along with this program. If not, see .
16 |
17 | from fedoracommunity.config.app_cfg import base_config
18 | from fedoracommunity.config.environment import load_environment
19 |
20 | import tg
21 | try:
22 | tg_version_tuple = tuple(map(int, tg.__version__.split('.')[:2]))
23 | except ValueError:
24 | tg_version_tuple = tuple(tg.__version__.split('.')[:2])
25 |
26 | make_base_app = base_config.setup_tg_wsgi_app(load_environment)
27 |
28 |
29 | def make_app(global_conf, full_stack=True, **app_conf):
30 | from moksha.wsgi.middleware import make_moksha_middleware
31 | from fedoracommunity.connectors.api.mw import FCommConnectorMiddleware
32 |
33 | def make_middleware(app):
34 | if tg_version_tuple < (2, 1):
35 | app = base_config.add_tosca2_middleware(app)
36 |
37 | app = FCommConnectorMiddleware(app)
38 | app = make_moksha_middleware(app, tg.config)
39 | return app
40 |
41 | if tg_version_tuple >= (2, 1):
42 | app_conf['custom_tw2_config'] = {
43 | 'script_name': global_conf.get('fedoracommunity.script_name', '/')
44 | }
45 |
46 | app = make_base_app(global_conf,
47 | wrap_app=make_middleware,
48 | full_stack=full_stack,
49 | **app_conf)
50 |
51 | if base_config.squeeze:
52 | from repoze.squeeze.processor import ResourceSqueezingMiddleware
53 | app = ResourceSqueezingMiddleware(
54 | app,
55 | cache_dir='public/cache',
56 | url_prefix='/cache/',
57 | )
58 |
59 | if base_config.profile:
60 | from repoze.profile.profiler import AccumulatingProfileMiddleware
61 | app = AccumulatingProfileMiddleware(
62 | app,
63 | log_filename='profile.log',
64 | discard_first_request=True,
65 | cachegrind_filename='./cachegrind.out',
66 | flush_at_shutdown=True,
67 | path='/__profile__'
68 | )
69 |
70 | return app
71 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/package/templates/contents.mak:
--------------------------------------------------------------------------------
1 |
2 |
3 |
55 |
56 |
57 |
58 |
61 |
62 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/widgets.py:
--------------------------------------------------------------------------------
1 | # This file is part of Fedora Community.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU Affero General Public License as
6 | # published by the Free Software Foundation, either version 3 of the
7 | # License, or (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU Affero General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU Affero General Public License
15 | # along with this program. If not, see .
16 |
17 | import tw2.core as twc
18 | from tw2.core.params import Param
19 |
20 |
21 | class PagerWidget(twc.Widget):
22 | template = "mako:/myfedora/widgets/templates/pager.html"
23 | page = twc.Param('The page to view', default=1)
24 | last_page = twc.Param()
25 | show = twc.Param('The number of items to show', default=7)
26 | parent_dom_id = twc.Param()
27 |
28 | front_set = twc.Variable()
29 | back_set = twc.Variable()
30 | main_set = twc.Variable()
31 | prev_page = twc.Variable()
32 | next_page = twc.Variable()
33 | parent_id = twc.Variable()
34 |
35 | def prepare(self):
36 | super(PagerWidget, self).prepare()
37 |
38 | self.page = int(self.page)
39 | if self.page < 1:
40 | self.page = 1
41 |
42 | self.last_page = int(self.last_page)
43 |
44 | # how many of the main set do we show
45 | self.show = int(self.show)
46 |
47 | self.parent_id = self.parent_dom_id
48 |
49 | self.front_set = []
50 | self.back_set = []
51 | self.main_set = []
52 |
53 | max_block_num = self.last_page / self.show
54 |
55 | # figure out main set
56 | block_num = self.page / self.show
57 |
58 | start = block_num * self.show + 1
59 | last_in_set = start + self.show
60 | if last_in_set >= self.last_page:
61 | start = self.last_page - self.show + 1
62 | if start < 1:
63 | start = 1
64 |
65 | last_in_set = self.last_page + 1
66 | block_num = max_block_num
67 |
68 | self.main_set = range(start, last_in_set)
69 |
70 | # do we need a front set
71 | if block_num > 0:
72 | self.front_set = [1]
73 |
74 | # do we need a back set
75 | if block_num < max_block_num:
76 | self.back_set = [self.last_page]
77 |
78 | self.prev_page = None
79 | if self.page > 1:
80 | self.prev_page = self.page - 1
81 |
82 | self.next_page = None
83 | if self.page < self.last_page:
84 | self.next_page = self.page + 1
85 |
--------------------------------------------------------------------------------
/fedoracommunity/public/css/reset.css:
--------------------------------------------------------------------------------
1 | /* `XHTML, HTML4, HTML5 Reset
2 | ----------------------------------------------------------------------------------------------------*/
3 |
4 | a,
5 | abbr,
6 | acronym,
7 | address,
8 | applet,
9 | article,
10 | aside,
11 | audio,
12 | b,
13 | big,
14 | blockquote,
15 | body,
16 | canvas,
17 | caption,
18 | center,
19 | cite,
20 | code,
21 | dd,
22 | del,
23 | details,
24 | dfn,
25 | dialog,
26 | div,
27 | dl,
28 | dt,
29 | em,
30 | embed,
31 | fieldset,
32 | figcaption,
33 | figure,
34 | font,
35 | footer,
36 | form,
37 | h1,
38 | h2,
39 | h3,
40 | h4,
41 | h5,
42 | h6,
43 | header,
44 | hgroup,
45 | hr,
46 | html,
47 | i,
48 | iframe,
49 | img,
50 | ins,
51 | kbd,
52 | label,
53 | legend,
54 | li,
55 | mark,
56 | menu,
57 | meter,
58 | nav,
59 | object,
60 | ol,
61 | output,
62 | p,
63 | pre,
64 | progress,
65 | q,
66 | rp,
67 | rt,
68 | ruby,
69 | s,
70 | samp,
71 | section,
72 | small,
73 | span,
74 | strike,
75 | strong,
76 | sub,
77 | summary,
78 | sup,
79 | table,
80 | tbody,
81 | td,
82 | tfoot,
83 | th,
84 | thead,
85 | time,
86 | tr,
87 | tt,
88 | u,
89 | ul,
90 | var,
91 | video,
92 | xmp {
93 | border: 0;
94 | margin: 0;
95 | padding: 0;
96 | font-size: 100%;
97 | }
98 |
99 | html,
100 | body {
101 | height: 100%;
102 | }
103 |
104 | article,
105 | aside,
106 | details,
107 | figcaption,
108 | figure,
109 | footer,
110 | header,
111 | hgroup,
112 | menu,
113 | nav,
114 | section {
115 | /*
116 | Override the default (display: inline) for
117 | browsers that do not recognize HTML5 tags.
118 |
119 | IE8 (and lower) requires a shiv:
120 | http://ejohn.org/blog/html5-shiv
121 | */
122 | display: block;
123 | }
124 |
125 | b,
126 | strong {
127 | /*
128 | Makes browsers agree.
129 | IE + Opera = font-weight: bold.
130 | Gecko + WebKit = font-weight: bolder.
131 | */
132 | font-weight: bold;
133 | }
134 |
135 | img {
136 | color: transparent;
137 | font-size: 0;
138 | vertical-align: middle;
139 | /*
140 | For IE.
141 | http://css-tricks.com/ie-fix-bicubic-scaling-for-images
142 | */
143 | -ms-interpolation-mode: bicubic;
144 | }
145 |
146 | li {
147 | /*
148 | For IE6 + IE7.
149 | */
150 | display: list-item;
151 | }
152 |
153 | table {
154 | border-collapse: collapse;
155 | border-spacing: 0;
156 | }
157 |
158 | th,
159 | td,
160 | caption {
161 | font-weight: normal;
162 | vertical-align: top;
163 | text-align: left;
164 | }
165 |
166 | q {
167 | quotes: none;
168 | }
169 |
170 | q:before,
171 | q:after {
172 | content: '';
173 | content: none;
174 | }
175 |
176 | sub,
177 | sup,
178 | small {
179 | font-size: 75%;
180 | }
181 |
182 | sub,
183 | sup {
184 | line-height: 0;
185 | position: relative;
186 | vertical-align: baseline;
187 | }
188 |
189 | sub {
190 | bottom: -0.25em;
191 | }
192 |
193 | sup {
194 | top: -0.5em;
195 | }
196 |
197 | svg {
198 | /*
199 | For IE9.
200 | */
201 | overflow: hidden;
202 | }
--------------------------------------------------------------------------------
/fedoracommunity/widgets/package/templates/package_chrome.mak:
--------------------------------------------------------------------------------
1 |
2 | <%
3 | from urllib import quote
4 | import tg
5 |
6 | icon = w.package_info['icon']
7 | package_name = w.kwds['package_name']
8 | if package_name != w.package_info['name']:
9 | # subpackage
10 | for sub_pkg in w.package_info['sub_pkgs']:
11 | if sub_pkg['name'] == package_name:
12 | sub_icon = sub_pkg.get('icon', None)
13 | if sub_icon:
14 | icon = sub_icon
15 |
16 | break
17 |
18 | icon_url = tg.url("/images/icons/%s" % icon)
19 | %>
20 |
81 | This package has no bugs - go file some!!!
82 |
83 |
84 |
89 |
90 |
91 | Viewing ${'${first_visible_row}'}-${'${last_visible_row}'} of ${'${total_rows}'} bugs
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/fedoracommunity/connectors/fafconnector.py:
--------------------------------------------------------------------------------
1 | # This file is part of Fedora Community.
2 | # Copyright (C) 2008-2010 Red Hat, Inc.
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU Affero General Public License as
6 | # published by the Free Software Foundation, either version 3 of the
7 | # License, or (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU Affero General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU Affero General Public License
15 | # along with this program. If not, see .
16 |
17 | import requests
18 | from paste.httpexceptions import HTTPBadRequest
19 | from paste.httpexceptions import HTTPBadGateway
20 |
21 | from fedoracommunity.connectors.api import \
22 | IConnector, IQuery, ParamFilter
23 |
24 | class FafConnector(IConnector, IQuery):
25 | _method_paths = {}
26 | _query_paths = {}
27 | _cache_prompts = {}
28 |
29 | # IConnector
30 | @classmethod
31 | def register(cls):
32 | cls.register_query_problems()
33 |
34 | #IQuery
35 | @classmethod
36 | def register_query_problems(cls):
37 | path = cls.register_query(
38 | 'query_problems',
39 | cls.query_problems,
40 | cache_prompt=None,
41 | primary_key_col='id',
42 | default_sort_col='count',
43 | default_sort_order=-1,
44 | can_paginate=True)
45 |
46 | path.register_column(
47 | 'id',
48 | default_visible=True,
49 | can_sort=True,
50 | can_filter_wildcards=False)
51 |
52 | path.register_column(
53 | 'status',
54 | default_visible=True,
55 | can_sort=True,
56 | can_filter_wildcards=False)
57 |
58 | path.register_column(
59 | 'crash_function',
60 | default_visible=True,
61 | can_sort=True,
62 | can_filter_wildcards=True)
63 |
64 | path.register_column(
65 | 'count',
66 | default_visible=True,
67 | can_sort=True,
68 | can_filter_wildcards=False)
69 |
70 | f = ParamFilter()
71 | f.add_filter('package_name', list(), allow_none=False)
72 | cls._query_problems_filter = f
73 |
74 | def query_problems(self, start_row=None,
75 | rows_per_page=10,
76 | order=-1,
77 | sort_col=None,
78 | filters=None,
79 | **params):
80 |
81 | if not filters:
82 | filters = {}
83 |
84 | if not filters.get('package_name'):
85 | raise HTTPBadRequest('"package_name" is a required filter.')
86 |
87 | package = filters['package_name']
88 |
89 | url = "https://retrace.fedoraproject.org/faf/problems/?component_names={package}&limit={rows}"
90 | url = url.format(package=package, rows=rows_per_page)
91 |
92 | headers = {'Accept': 'application/json'}
93 |
94 | response = requests.get(url, headers=headers)
95 |
96 | if not bool(response):
97 | raise HTTPBadGateway("Failed to talk to ABRT Analytics, %r %r" % (url, response))
98 |
99 | data = response.json()
100 | if 'problems' in data:
101 | problems = data['problems']
102 | else:
103 | raise HTTPBadGateway("Got unexpected response from ABRT Analytics.")
104 |
105 | return (len(problems), problems)
106 |
--------------------------------------------------------------------------------
/tests/cassettes/test_Indexer_latest_active.yaml:
--------------------------------------------------------------------------------
1 | interactions:
2 | - request:
3 | body: null
4 | headers:
5 | Accept-Encoding: ['gzip, deflate']
6 | Connection: [keep-alive]
7 | Cookie: [SERVERID=pdc-web01]
8 | User-Agent: [python-requests/2.18.4]
9 | accept: [application/json]
10 | content-type: [application/json]
11 | method: GET
12 | uri: https://pdc.fedoraproject.org/rest_api/v1/component-branches/?active=True&type=rpm&global_component=guake&page_size=100&page=1
13 | response:
14 | body:
15 | string: !!binary |
16 | H4sIAAAAAAAAA6WT3Y7CIBCF34XrNgFaoPVVNsZgHZUsbQkFf2J89x3d1O5G0zbKFUPmgzlnmAup
17 | 2tgEshAJaeCEmyZamxDn4WDa2PWxhy7agOHXhZgNWShZSpmQnW3X2q6qtnZtA7d7yC7qbyB4m64B
18 | Q7ASg87qgWUiK0p+P8SELui1hZV2BvOgtXjEKacpY2lGyTUZmII9GKiiN+G82poTdFOcynpuHXcj
19 | yDIh4exuRXtXY4augjlgGHyEhFT4oKlQrNNhTxZbbTvoX1GKKj7LDQdWPfuRMyrG/chTKv/rymkp
20 | pv14xRVi1I8H8okfTM7yY8tf/I6cKzWpjBUpVSllf5VxqcaUDcj7yjJeiKycJ+2p0VL8Ts1oifgZ
21 | ef5QdUem+zxwHzRNFsWska51F8C/mGrFaV+p18e92cBQIi60/l33l9cfzigTzqkEAAA=
22 | headers:
23 | allow: ['GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS']
24 | appserver: [proxy12.fedoraproject.org]
25 | apptime: [D=278077]
26 | cache-control: ['private, max-age=0, must-revalidate']
27 | connection: [Keep-Alive]
28 | content-encoding: [gzip]
29 | content-length: ['335']
30 | content-type: [application/json]
31 | date: ['Fri, 09 Feb 2018 10:00:16 GMT']
32 | keep-alive: ['timeout=15, max=500']
33 | referrer-policy: [same-origin]
34 | server: [Apache/2.4.6 (Red Hat Enterprise Linux) mod_wsgi/3.4 Python/2.7.5]
35 | strict-transport-security: [max-age=15768000; includeSubDomains; preload]
36 | vary: ['Accept,Cookie,Accept-Encoding']
37 | x-content-type-options: [nosniff]
38 | x-frame-options: [SAMEORIGIN, SAMEORIGIN]
39 | x-xss-protection: [1; mode=block]
40 | status: {code: 200, message: OK}
41 | - request:
42 | body: null
43 | headers:
44 | Accept-Encoding: ['gzip, deflate']
45 | Connection: [keep-alive]
46 | Cookie: [SERVERID=pdc-web01]
47 | User-Agent: [python-requests/2.18.4]
48 | accept: [application/json]
49 | content-type: [application/json]
50 | method: GET
51 | uri: https://pdc.fedoraproject.org/rest_api/v1/component-branches/?active=True&type=rpm&global_component=chromium&page_size=100&page=1
52 | response:
53 | body:
54 | string: !!binary |
55 | H4sIAAAAAAAAA6WR3YrCMBCF32WuW0jSmu76KotIGqcaSJuQH1cR332nQu3CihU3V5khZzLfORfQ
56 | Lg8J1nUBA57oMmRrC/ABj8blONUBY7aJyq8LmB2suWgYK2BvXavsVrveuwHHOaAPwfUm90ADVY/U
57 | QY+2oTJaNQ8Qq7oWtx69iEm1FrfKG3qGzlJLMFGXTJYVg2sxS/hdgjoHk87bzpwwLsiqZpK1ef9E
58 | sSkgnf24c/AjgNLJHKlMIWMBmv4zmnC9SgdYd8pGnD4hP7h40Y9OyAduSLmIxj9K1pSM/0aT9TO0
59 | WfE+WiVWYjTwRbY/ScsVq6RY2JLzUtR3rptkOepZ95/g5OercL2KCcOD7Kpq2jWo74PZ4bwkHfL/
60 | 3Qg21x+OkdBnoQMAAA==
61 | headers:
62 | allow: ['GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS']
63 | appserver: [proxy12.fedoraproject.org]
64 | apptime: [D=212775]
65 | cache-control: ['private, max-age=0, must-revalidate']
66 | connection: [Keep-Alive]
67 | content-encoding: [gzip]
68 | content-length: ['298']
69 | content-type: [application/json]
70 | date: ['Fri, 09 Feb 2018 10:00:16 GMT']
71 | keep-alive: ['timeout=15, max=499']
72 | referrer-policy: [same-origin]
73 | server: [Apache/2.4.6 (Red Hat Enterprise Linux) mod_wsgi/3.4 Python/2.7.5]
74 | strict-transport-security: [max-age=15768000; includeSubDomains; preload]
75 | vary: ['Accept,Cookie,Accept-Encoding']
76 | x-content-type-options: [nosniff]
77 | x-frame-options: [SAMEORIGIN, SAMEORIGIN]
78 | x-xss-protection: [1; mode=block]
79 | status: {code: 200, message: OK}
80 | version: 1
81 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | **fedora-packages** allows to search for packages in Fedora.
2 |
3 | ## Documentation
4 | Would be nice to have a bit more documentation.
5 |
6 | ### Hacking with docker-compose
7 |
8 | We have a `docker-compose` setup for hacking on the fedora-packages app.
9 | This setup matches the production deployment of fedora-packages (i.e.
10 | Apache HTTP server with `mod_wsgi`) that is split over several Ansible
11 | files in Fedora infrastructure repository.
12 |
13 | * https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/playbooks/groups/packages.yml
14 | * https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/packages3/web
15 |
16 | To bring the environment up you should first install the following.
17 |
18 | $ sudo dnf install docker-compose
19 |
20 | And then make sure that the docker daemon is running.
21 |
22 | $ sudo systemctl start docker
23 | $ sudo systemctl enable docker
24 |
25 | If you do not wish to run docker-compose using `sudo` you will need to add
26 | your user to the docker group as follow.
27 |
28 | $ sudo groupadd docker && sudo gpasswd -a $USER docker
29 | $ MYGRP=$(id -g) ; newgrp docker ; newgrp $MYGRP
30 |
31 | This is has for effect to give root permission to users added to the docker
32 | group.
33 |
34 | Now from the devel directory you can run docker-compose.
35 |
36 | $ cd devel
37 | $ docker-compose up
38 |
39 | The first time you execute this command, it will build a docker container and it will
40 | take few minutes. Once the build is finish and the application is started you can access
41 | the fedora-packages using this url http://127.0.0.1/packages
42 |
43 | #### Reloading the application after code changes
44 | Since we are using apache HTTP server to serve the application we need to run the following
45 | command to reload the application to test some code changes.
46 |
47 | $ cd devel
48 | $ docker-compose exec web touch /usr/share/fedoracommunity/fedora-packages.wsgi
49 |
50 | This will change the timestamp of the .wsgi file and ask apache to reload the application.
51 |
52 | #### Running the unit tests
53 | To execute the test suite simply run the following command
54 |
55 | $ docker-compose exec web py.test /usr/share/fedoracommunity/tests
56 |
57 |
58 | ### Hacking with Vagrant
59 |
60 | We have a simple vagrant setup for hacking on the fedora-packages app.
61 |
62 | First, install Ansible, Vagrant, the vagrant-sshfs plugin, and the
63 | vagrant-libvirt plugin from the official Fedora repos:
64 |
65 | $ sudo dnf install ansible vagrant vagrant-libvirt vagrant-sshfs
66 |
67 | Now, from within main directory (the one with the Vagrantfile in it)
68 | of your git checkout of fedora-pacakges, run the vagrant up command to provision
69 | your dev environment:
70 |
71 | $ vagrant up
72 |
73 | When this command is completed (it may take a while) you will be able to
74 | ssh into your dev VM with vagrant ssh and then run the command to start the fedora-packages server:
75 |
76 | $ vagrant ssh
77 | [vagrant@localhost ~]$ pushd /vagrant/; gearbox serve;
78 |
79 | Once that is running, simply go to http://localhost:8080/ in your browser on
80 | your host to see your running fedora-packages test instance.
81 |
82 |
83 | ## Create a new release.
84 |
85 | To create a new release, you need to update `setup.py` and `fedora-packages.spec`
86 | with the new version number and any dependencies added or removed.
87 |
88 | The `CHANGELOG.rst` needs also to be updated with the commits and pull-requests
89 | included in the release.
90 |
91 | Once these 3 files have been updated and commited to the develop branch, you create a new
92 | Git tag.
93 |
94 | $ git tag -a 4.1.0 -s -m 'Release 4.1.0'
95 | $ git push && git push --tag
96 |
97 | Once the tag has been successfully pushed, a new release will be available in github.
98 |
99 | ## License
100 | fedora-packages is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0. See COPYING included with the distribution for details.
101 |
--------------------------------------------------------------------------------
/fedoracommunity/widgets/package/templates/details.mak:
--------------------------------------------------------------------------------
1 | <% import tg %>
2 |