aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorArturo FilastoĢ€ <hellais@torproject.org>2011-08-23 15:15:27 +0200
committerArturo FilastoĢ€ <hellais@torproject.org>2011-08-23 15:15:27 +0200
commit6f17b6fbc8f1accdfff5e5a5503baf7eafc9dc08 (patch)
tree75a82a7fe5e22713ffc1c943ebc82a2871412db9 /packages
parent8687350c9d572d2253b31a0739f04e1ddffc0d5f (diff)
downloadtorouter-6f17b6fbc8f1accdfff5e5a5503baf7eafc9dc08.tar.gz
torouter-6f17b6fbc8f1accdfff5e5a5503baf7eafc9dc08.zip
* Fix issue with distutils
* Temporarily move the style sheet to base.html * Fix issues related to absolute paths * Correct pid file location * misc cleanup
Diffstat (limited to 'packages')
-rw-r--r--packages/torouter-web/setup.py6
-rw-r--r--packages/torouter-web/src/runui.py2
-rw-r--r--packages/torouter-web/src/tui/view.py5
-rw-r--r--packages/torouter-web/src/tui/views/base.html55
4 files changed, 62 insertions, 6 deletions
diff --git a/packages/torouter-web/setup.py b/packages/torouter-web/setup.py
index a0e5c65..fe01ab8 100644
--- a/packages/torouter-web/setup.py
+++ b/packages/torouter-web/setup.py
@@ -4,8 +4,8 @@ from distutils.core import setup
setup(name='torouter-tui',
packages=['tui', 'tui.controllers',
'tui.models', 'tui.utils'],
- package_dir = {'tui': 'src/tui/'},
- package_data = {'tui': ['src/tui/', 'views/*html']},
+ package_dir = {'tui': 'src/tui'},
+ package_data = {'tui': ['src/tui', 'views/*html']},
data_files = [('/usr/share/torouter-tui/static',
['src/static/main.css'])],
version='0.1',
@@ -13,5 +13,5 @@ setup(name='torouter-tui',
author='Arturo Filasto',
author_email='hellais@torproject.org',
url='https://www.torproject.org/',
- scripts=['src/runui.py', 'src/tui/view.py', 'src/tui/config.py', 'src/daemon.py'])
+ scripts=['src/runui.py', 'src/daemon.py'])
diff --git a/packages/torouter-web/src/runui.py b/packages/torouter-web/src/runui.py
index b016ea9..87c6626 100644
--- a/packages/torouter-web/src/runui.py
+++ b/packages/torouter-web/src/runui.py
@@ -41,7 +41,7 @@ DEBUG = False
if __name__ == "__main__":
if DEBUG:
app.run()
- service = TorWebDaemon(os.path.join(os.getcwd(),'tui.pid'))
+ service = TorWebDaemon('/tmp/tui.pid')
if len(sys.argv) == 2:
if 'start' == sys.argv[1]:
sys.argv[1] = '8080'
diff --git a/packages/torouter-web/src/tui/view.py b/packages/torouter-web/src/tui/view.py
index 0252ad8..48b03c5 100644
--- a/packages/torouter-web/src/tui/view.py
+++ b/packages/torouter-web/src/tui/view.py
@@ -1,3 +1,4 @@
+import os
import web
from tui import config
@@ -5,7 +6,9 @@ t_globals = dict(
datestr=web.datestr,
)
+# get the path where the script currently resides
+current_path = "/".join(os.path.abspath(__file__).split("/")[:-1])
# create the render object
-render = web.template.render('tui/views', cache=config.cache, globals=t_globals)
+cender = web.template.render(current_path+'/views', cache=config.cache, globals=t_globals)
render._keywords['globals']['render'] = render
diff --git a/packages/torouter-web/src/tui/views/base.html b/packages/torouter-web/src/tui/views/base.html
index bce4110..5db0249 100644
--- a/packages/torouter-web/src/tui/views/base.html
+++ b/packages/torouter-web/src/tui/views/base.html
@@ -5,7 +5,60 @@ $def with (page,submenu=None)
<html>
<head>
<title>TUI - Tor Web User Interface</title>
- <link REL="stylesheet" href="/static/main.css" type="text/css">
+<style type="text/css">
+/* Clear all */
+body { margin: 0;border: 0;padding: 0; }
+
+div.wrapper {
+ min-height: 300px;
+ width: 800px;
+ margin: 0 auto;
+}
+
+div.footer {
+ text-align: center;
+ background-color: #333;
+ color: white;
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
+
+div.header {
+ color: white;
+}
+
+div.header ul {
+ list-style: none;
+ height: 20px;
+}
+
+div.header ul li {
+ font-size: 20px;
+ float: left;
+ padding: 5px 10px;
+}
+
+div.header ul#submenu li {
+ font-size: 15px;
+}
+
+div.header ul#submenu li a.sel {
+ color: black;
+ text-decoration: none;
+}
+
+/* More specific stuff */
+#torrc {
+list-style: none;
+line-height: 2em;
+}
+
+#torrc em {
+font-weight: bold;
+font-style: normal;
+}
+</style>
+<!-- link REL="stylesheet" href="/static/main.css" type="text/css" -->
</head>
<body>
<div class="header">