forked from cherokee/web
/
PageDistro.py
109 lines (85 loc) · 4.02 KB
/
PageDistro.py
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
# -*- Mode: python; coding: utf-8 -*-
#
# Cherokee Web Site
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2011 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
import os
import CTK
import Page
import Distro
URL_BASE = "/distribution"
P1 = """The Cherokee Web App Distribution is a worldwide effort to
eases the deployment of Web Applications. Independent contributors and
ISVs from all over the globe are working together in an open,
transparent and friendly manner to bring you this revolutionary way of
deploying Web applications."""
P2 = """It is specially interesting to notice that the project is
driven by its community. Everybody is welcome to join in!"""
JOIN_P1 = """<b>Independent maintainers/packagers and ISVs are welcome to
join to join the Cherokee Distribution</b>. If you know of any Web
application that you would like to add to the Cherokee Distribution, do not
hesitate to join the <a href="http://lists.octality.com/listinfo/distribution"
target="_blank">Distribution mailing list</a>.
"""
JOIN_P2 = """It is fairly straightforward to add a new package to the distribution:"""
JOIN_L1 = {
'Initial Check': """Check that the application is either <i>Orphan</i> or has not been packaged yet. You'll find a list of orphan application on this page.""",
'Create the package': """We have written a few tutorials on how to create a package. Find then on the <a href="/doc">documentation</a>. In case you had any question, do not hesitate to ask on the <a href="http://lists.octality.com/listinfo/distribution" target="_blank">Distribution mailing list</a>.""",
'Submit your package': """Submit us the source code directory of your package. The Distribution mailing list will be again the right place."""
}
JOIN_P3 = """Once your package make it to the distribution, you will
receive a repository account, so you can maintain it in the future."""
MAINTAINERS_P1 = """A number of maintainers already work on this
project in order to brind you these packages. We'd like to take the
opportunity to thank them from these lines:"""
ORPHANS_P1 = """
There is a number of orphan packages waiting for a developer to adopt them.
"""
class Distribution:
def __call__ (self):
title = _("Web Applications Distribution")
# Intro
page = Page.Page_Menu_Side (title=title)
page += CTK.RawHTML ("<h1>%s</h1>" %(title))
page += CTK.RawHTML ("<p>%s</p>" %(P1))
page += CTK.RawHTML ("<p>%s</p>" %(P2))
# Apps
page.sidebar += CTK.RawHTML ("<h2>Apps</h2>")
page.sidebar += Distro.Apps_List()
# Join
page += CTK.RawHTML ("<h2>Join the Maintainers Team!</h2>")
page += CTK.RawHTML ("<p>%s</p>" %(JOIN_P1))
page += CTK.RawHTML ("<p>%s</p>" %(JOIN_P2))
l = CTK.List()
page += l
for k in JOIN_L1:
l += CTK.RawHTML ("<b>%s</b>: %s"%(k, JOIN_L1[k]))
page += CTK.RawHTML ("<p>%s</p>" %(JOIN_P3))
# Maintainers
page += CTK.RawHTML ("<h2>Maintainer</h2>")
page += CTK.RawHTML ("<p>%s</p>" %(MAINTAINERS_P1))
page += Distro.Authors_List()
if Distro.get_orphans():
page += CTK.RawHTML ("<h2>Orphan Packages</h2>")
page += CTK.RawHTML ("<p>%s</p>" %(ORPHANS_P1))
page += Distro.Orphans_List()
return CTK.HTTP_Cacheable (60, body=page.Render())
CTK.publish (r'^%s(\.html)?$'%(URL_BASE), Distribution)