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
|
From: Christian Kastner <ckk@kvr.at>
Date: Sat, 22 Nov 2014 20:48:21 +0100
Subject: Use jQuery libraries from the Debian archive
Forwarded: not-needed
Last-Update: 2020-03-30
---
gitinspector/format.py | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/gitinspector/format.py b/gitinspector/format.py
index b9e887f..9202d6f 100644
--- a/gitinspector/format.py
+++ b/gitinspector/format.py
@@ -57,22 +57,23 @@ def __output_html_template__(name):
file_r = open(template_path, "rb")
return file_r.read().decode("utf-8", "replace")
-def __get_zip_file_content__(name, file_name="/html/flot.zip"):
- zip_file = zipfile.ZipFile(basedir.get_basedir() + file_name, "r")
- content = zip_file.read(name)
- zip_file.close()
- return content.decode("utf-8", "replace")
-
def output_header():
if __selected_format__ == "html" or __selected_format__ == "htmlembedded":
base = basedir.get_basedir()
html_header = __output_html_template__(base + "/html/html.header")
- tablesorter_js = __get_zip_file_content__("jquery.tablesorter.min.js",
- "/html/jquery.tablesorter.min.js.zip").encode("latin-1", "replace")
- tablesorter_js = tablesorter_js.decode("utf-8", "ignore")
- flot_js = __get_zip_file_content__("jquery.flot.js")
- pie_js = __get_zip_file_content__("jquery.flot.pie.js")
- resize_js = __get_zip_file_content__("jquery.flot.resize.js")
+ tablesorter_js = None
+ flot_js = None
+ pie_js = None
+ resize_js = None
+ jquery_js = None
+ with open('/usr/share/javascript/jquery-tablesorter/jquery.tablesorter.js', 'rb') as js:
+ tablesorter_js = js.read().decode("utf-8", "replace")
+ with open('/usr/share/javascript/jquery-flot/jquery.flot.js', 'rb') as js:
+ flot_js = js.read().decode("utf-8", "replace")
+ with open('/usr/share/javascript/jquery-flot/jquery.flot.pie.js', 'rb') as js:
+ pie_js = js.read().decode("utf-8", "replace")
+ with open('/usr/share/javascript/jquery-flot/jquery.flot.resize.js', 'rb') as js:
+ resize_js = js.read().decode("utf-8", "replace")
logo_file = open(base + "/html/gitinspector_piclet.png", "rb")
logo = logo_file.read()
@@ -80,7 +81,8 @@ def output_header():
logo = base64.b64encode(logo)
if __selected_format__ == "htmlembedded":
- jquery_js = ">" + __get_zip_file_content__("jquery.js")
+ with open('/usr/share/javascript/jquery/jquery.js', 'rb') as js:
+ jquery_js = ">" + js.read().decode("utf-8", "replace")
else:
jquery_js = " src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\">"
|