diff --git a/scripts/repostats.py b/scripts/repostats.py
index f814110a..2703c8af 100755
--- a/scripts/repostats.py
+++ b/scripts/repostats.py
@@ -41,10 +41,10 @@ html_header = """
@@ -80,27 +80,6 @@ def_repo_sizes_html = u"""
"""
-def_packager_html = u"""
-
- Paketçi %(name)s
-
-
-
-
-
-
-
%(name)s <%(email)s>
-
-
Paketler:
-
%(sources)s
-
-
Güncellemeler:
-
%(updates)s
-
-
-"""
-
def_package_html = u"""
İkili paket %(name)s
@@ -269,9 +248,13 @@ def template_write(filename, tmpl_name, dict):
def write_html(filename, title, content):
f = codecs.open(filename, "w", "utf-8")
+ root = "./"
+ if len(filename.split("/")) > 2:
+ root = "../"
dict = {
"title": title,
"content": content,
+ "root": root,
}
f.write(html_header % dict)
f.close()
@@ -294,6 +277,11 @@ def make_table(elements, titles=None):
return html
+def make_url(name, path="./"):
+ if not path.endswith("/"):
+ path += "/"
+ return "%s" % (path, name, name)
+
def template_table(tmpl_name, list):
tmpl = template_get(tmpl_name)
data = ""
@@ -489,17 +477,30 @@ class Packager:
Packager(spec, update)
def report_html(self):
- srcs = map(lambda x: "%s" % (x, x), self.sources)
+ srcs = map(lambda x: ("%s" % (x, x), ), self.sources)
srcs.sort()
- upds = map(lambda x: "%s (%s)
%s
" % (
- x[0], x[0], x[1], x[2]), self.updates)
- dict = {
- "name": self.name,
- "email": mangle_email(self.email),
- "sources": "
".join(srcs),
- "updates": " ".join(upds)
- }
- template_write("paksite/packager/%s.html" % self.name, "packager", dict)
+ upds = map(lambda x: (u"%s (%s)
%s
" % (
+ x[0], x[0], x[1], x[2]), ), self.updates)
+
+ html = """
+ Paketçi: %s (%s)
+ """ % (self.name, mangle_email(self.email))
+
+ html += """
+
+
Sahip olduğu paketler:
+ %s
+
+ """ % make_table(srcs)
+
+ html += """
+
+
Yaptığı güncellemeler:
+ %s
+
+ """ % make_table(upds)
+
+ write_html("paksite/packager/%s.html" % self.name, self.name, html)
class Repository:
@@ -620,12 +621,12 @@ class Repository:
titles = "Paket adı", "Versiyon", "Açıklama"
- srclist = map(lambda x: (x.name, x.spec.getSourceVersion(), x.spec.source.summary), sources.values())
+ srclist = map(lambda x: (make_url(x.name, "source/"), x.spec.getSourceVersion(), x.spec.source.summary), sources.values())
srclist.sort(key=lambda x: x[0])
html = make_table(srclist, titles)
write_html("paksite/sources.html", "Kaynak Paketler", html)
- binlist = map(lambda x: (x.name, x.source.spec.getSourceVersion(), x.source.spec.source.summary), packages.values())
+ binlist = map(lambda x: (make_url(x.name, "binary/"), x.source.spec.getSourceVersion(), x.source.spec.source.summary), packages.values())
binlist.sort(key=lambda x: x[0])
html = make_table(binlist, titles)
write_html("paksite/binaries.html", "İkili Paketler", html)