From ab73c797f1ab622b891c98e3ba4aaf9002939b69 Mon Sep 17 00:00:00 2001 From: Paul Busch Date: Sun, 10 Jul 2011 22:48:26 +0200 Subject: [PATCH] config also as template --- data/interfaces/default/config.tmpl | 57 +++++++++++++++-------------- webServer.py | 12 +++--- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/data/interfaces/default/config.tmpl b/data/interfaces/default/config.tmpl index b5b2fa8b..0697a50d 100644 --- a/data/interfaces/default/config.tmpl +++ b/data/interfaces/default/config.tmpl @@ -1,4 +1,5 @@ #import os.path +#import config #include os.path.abspath($appPath+"/data/interfaces/default/_inc_header.tmpl")
@@ -17,14 +18,14 @@

HTTP Host:

-
+
i.e. localhost or 0.0.0.0

HTTP Username:

- +

@@ -33,21 +34,21 @@

HTTP Port:

- +

HTTP Password:

- +

-

Launch Browser on Startup:

+

Launch Browser on Startup:

@@ -57,13 +58,13 @@ @@ -71,13 +72,13 @@ @@ -85,13 +86,13 @@
-

SABnzbd Host:


+

SABnzbd Host:


usually localhost:8080
-

SABnzbd Username:

+

SABnzbd Username:


-

SABnzbd API:

+

SABnzbd API:


-

SABnzbd Password:

+

SABnzbd Password:


-

SABnzbd Category:

+

SABnzbd Category:


-

Music Download Directory:


+

Music Download Directory:


Absolute or relative path to the dir where SAB downloads your music
i.e. Downloads/music or /Users/name/Downloads/music
@@ -102,7 +103,7 @@

-

Usenet Retention:

+

Usenet Retention:

@@ -112,20 +113,20 @@ @@ -134,7 +135,7 @@ @@ -152,7 +153,7 @@

Newznab API:
- +

@@ -161,7 +162,7 @@ @@ -178,7 +179,7 @@

NZBs.org Hash:
- +

@@ -190,14 +191,14 @@ @@ -206,7 +207,7 @@ @@ -225,7 +226,7 @@
-

NZBMatrix:

+

NZBMatrix:

NZBMatrix Username:
- +

NZBMatrix API:
- +


-

Newznab:

+

Newznab:

@@ -142,7 +143,7 @@

Newznab Host:
-
+
i.e. http://nzb.su


-

NZBs.org:

+

NZBs.org:

@@ -169,7 +170,7 @@

NZBs.org UID:
- +

Album Quality:

- Include lossless
- Convert lossless to mp3 + Include lossless
+ Convert lossless to mp3

iTunes:

- Move downloads to iTunes + Move downloads to iTunes


-

Path to iTunes folder:
+

Path to iTunes folder:

i.e. Music/iTunes or /Users/name/Music/iTunes

@@ -214,9 +215,9 @@
Renaming & Metadata:

- Rename & add metadata + Rename & add metadata
- Delete leftover files + Delete leftover files


Album Art:

- Add album art + Add album art
diff --git a/webServer.py b/webServer.py index 4d308280..10ff0738 100644 --- a/webServer.py +++ b/webServer.py @@ -311,13 +311,11 @@ class Headphones: history.exposed = True def config(self): - page = [templates._header] - page.append(templates._logobar) - page.append(templates._nav) - page.append(config.form) - page.append(templates._footer) - return page - + filename = os.path.join(self.templatePath,"config.tmpl") + template = Template(file=filename) + template.rootPath = "." + template.appPath = "." + return str(template) config.exposed = True