1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
from django.conf.urls.defaults import url, patterns, include
from django.contrib.auth.decorators import user_passes_test
from djcelery.views import apply as apply_task
from djeuscan.views import registered_tasks
from euscan_accounts.views import favourite_package, unfavourite_package, \
favourite_category, unfavourite_category, favourite_herd, \
unfavourite_herd, favourite_maintainer, unfavourite_maintainer, \
favourite_overlay, unfavourite_overlay, favourite_world, unfavourite_world
from djeuscan.feeds import PackageFeed, CategoryFeed, HerdFeed, \
MaintainerFeed, GlobalFeed, WorldScanFeed
admin_required = user_passes_test(lambda u: u.is_superuser)
package_patterns = patterns('djeuscan.views',
url(r'^$', 'package', name="package"),
url(r'^feed/$', PackageFeed(), name='package_feed'),
url(r'^favourite/$', favourite_package, name="favourite_package"),
url(r'^unfavourite/$', unfavourite_package, name="unfavourite_package"),
url(r'^refresh$', "refresh_package", name="refresh_package"),
url(r'^problem$', 'problem', name="problem"),
)
files_patterns = patterns('djeuscan.views',
url(r'^(?P<overlay>[\w+][\w+.-]*)/(?P<cpv>.+).ebuild$',
"package_version_ebuild",
name="package_version_ebuild"),
url(r'^(?P<overlay>[\w+][\w+.-]*)/(?P<category>[\w+][\w+.-]*)/'
r'(?P<package>[\w+][\w+.-]*)/metadata.xml$',
"package_metadata",
name="package_metadata"),
)
categories_patterns = patterns('djeuscan.views',
url(r'^(?:view/)?$', 'category', name="category"),
url(r'^feed/$', CategoryFeed(), name='category_feed'),
url(r'^charts/(?P<chart>[\w\-]+).png$', 'chart_category',
name="chart_category"),
url(r'^favourite/$', favourite_category, name="favourite_category"),
url(r'^unfavourite/$', unfavourite_category,
name="unfavourite_category"),
)
herds_patterns = patterns('djeuscan.views',
url(r'^(?:view/)?$', 'herd', name="herd"),
url(r'^feed/$', HerdFeed(), name='herd_feed'),
url(r'^charts/(?P<chart>[\w\-]+).png$', 'chart_herd', name="chart_herd"),
url(r'^favourite/$', favourite_herd, name="favourite_herd"),
url(r'^unfavourite/$', unfavourite_herd, name="unfavourite_herd"),
)
maintainers_patterns = patterns('djeuscan.views',
url(r'^(?:view/)?$', 'maintainer', name="maintainer"),
url(r'^feed/$', MaintainerFeed(), name='maintainer_feed'),
url(r'^charts/(?P<chart>[\w\-]+).png$', 'chart_maintainer',
name="chart_maintainer"),
url(r'^favourite/$', favourite_maintainer, name="favourite_maintainer"),
url(r'^unfavourite/$', unfavourite_maintainer,
name="unfavourite_maintainer"),
)
overlays_patterns = patterns('djeuscan.views',
url(r'^(?:view/)?$', 'overlay', name="overlay"),
url(r'^favourite/$', favourite_overlay, name="favourite_overlay"),
url(r'^unfavourite/$', unfavourite_overlay, name="unfavourite_overlay"),
)
tasks_patterns = patterns('djeuscan.views',
url(r'^registered_tasks/$', admin_required(registered_tasks),
name="registered_tasks"),
url(r'^apply/(?P<task_name>.*)/$', admin_required(apply_task),
name="apply_task"),
)
urlpatterns = patterns('djeuscan.views',
# Global stuff
url(r'^api/', include('djeuscan.api.urls')),
url(r'^$', 'index', name="index"),
url(r'^feed/$', GlobalFeed(), name='global_feed'),
url(r'^about/$', 'about', name="about"),
url(r'^about/api$', 'api', name="api"),
url(r'^about/feeds$', 'feeds', name="feeds"),
url(r'^about/config$', 'config', name="config"),
url(r'^statistics/$', 'statistics', name="statistics"),
url(r'^statistics/handlers/(?P<handler>[^/]+)/$', 'statistics_handler',
name="statistics_handler"),
url(r'^statistics/charts/(?P<chart>[\w\-]+).png$', 'chart', name="chart"),
url(r'^world/$', 'world', name="world"),
url(r'^world/scan/$', 'world_scan', name="world_scan"),
url(r'^world/scan/feed$', WorldScanFeed(), name="world_scan_feed"),
url(r'^world/favourite/$', favourite_world, name="favourite_world"),
url(r'^world/unfavourite/$', unfavourite_world,
name="unfavourite_world"),
# Real data
url(r'^categories/$', 'categories', name="categories"),
url(r'^categories/(?P<category>[\w+][\w+.-]*)/',
include(categories_patterns)),
url(r'^herds/$', 'herds', name="herds"),
url(r'^herds/(?P<herd>[\@\{\}\w+.-]+)/', include(herds_patterns)),
url(r'^maintainers/$', 'maintainers', name="maintainers"),
url(r'^maintainers/(?P<maintainer_id>\d+)/',
include(maintainers_patterns)),
url(r'^maintainers/(?P<maintainer_email>[^/]+)/',
include(maintainers_patterns)),
url(r'^overlays/$', 'overlays', name="overlays"),
url(r'^overlays/(?P<overlay>[\w+][\w+.-]*)/', include(overlays_patterns)),
url(r'^package/(?P<category>[\w+][\w+.-]*)/(?P<package>[\w+][\w+.-]*)/',
include(package_patterns)),
url(r'^files/', include(files_patterns)),
url(r'^tasks/', include(tasks_patterns)),
)
|