summaryrefslogtreecommitdiff
path: root/cgi-bin/page.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi-bin/page.py')
-rw-r--r--cgi-bin/page.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cgi-bin/page.py b/cgi-bin/page.py
index 300069a..8bdbc0a 100644
--- a/cgi-bin/page.py
+++ b/cgi-bin/page.py
@@ -10,6 +10,8 @@ from config import Config
sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer)
+print("Content-type:text/html\n")
+
db = IssueDBFactory.produce()
cursor = db.cursor()
@@ -20,9 +22,13 @@ page_html = page_html_file.read()
issue_unit_html = issue_unit_html_file.read()
tag_unit_html = tag_unit_html_file.read()
+issue_unit_html_file.close()
+page_html_file.close()
+tag_unit_html_file.close()
+
issues_list = ""
issues_count = Config.get("config", "issues_count")
-try:
+try:
cursor.execute("select * from issue limit 0, 10")
issues_rows = cursor.fetchall()
odd = True
@@ -34,7 +40,8 @@ try:
for tag_row in tags_rows:
tag = tag_unit_html.format(\
tagid = tag_row[0],
- tag_name = tag_row[1]
+ tag_name = tag_row[1],
+ tag_count = ''
)
tagslist += tag
issue = issue_unit_html.format(\
@@ -66,12 +73,9 @@ page = page_html.format(\
)
# HTTP header
-print("Content-type:text/html\n")
print(page)
db.commit()
cursor.close()
db.close()
-issue_unit_html_file.close()
-page_html_file.close()