Forgot to commit paths.py for the reorganiation

master
James Gao 2014-10-23 11:46:44 -07:00
rodzic 5034ed1ce1
commit 6c4c189a46
3 zmienionych plików z 29 dodań i 2 usunięć

14
kiln/paths.py 100644
Wyświetl plik

@ -0,0 +1,14 @@
import os
basepath = os.path.join(os.environ['HOME'], ".config", "pipid")
profile_path = os.path.join(basepath, "profiles")
log_path = os.path.join(basepath, "logs")
if not os.path.exists(profile_path):
os.makedirs(profile_path)
if not os.path.exists(log_path):
os.makedirs(log_path)
cwd = os.path.abspath(os.path.split(__file__)[0])
html_static = os.path.join(cwd, "static")
html_templates = os.path.join(cwd, "templates")

Wyświetl plik

@ -1,3 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import time
@ -11,6 +14,8 @@ from tornado import websocket
import paths
cone_symbol = re.compile(r'\^([0-9]{1,3})')
class ClientSocket(websocket.WebSocketHandler):
def initialize(self, parent):
self.parent = parent
@ -28,7 +33,7 @@ class ManagerHandler(tornado.web.RequestHandler):
class MainHandler(ManagerHandler):
def get(self):
files = os.listdir(paths.profile_path)
fixname = lambda x: os.path.splitext(x)[0].replace("_", " ")
fixname = lambda x: cone_symbol.sub(r'Δ\1', os.path.splitext(x)[0].replace("_", " "))
profiles = dict((fname, fixname(fname)) for fname in files)
return self.render(os.path.join(paths.html_templates, "main.html"),
state=self.manager.state.__class__.__name__,

Wyświetl plik

@ -192,7 +192,15 @@ var tempgraph = (function(module) {
return temp * 9 / 5 + 32;
}
module.temp_to_cone = function(temp) {
return "Not implemented"
var cones = [600,614,635,683,717,747,792,804,838,852,884,894,900,923,955,984,999,1046,1060,1101,1120,1137,1154,1162,1168,1186,1196,1222,1240,1263,1280,1305,1315,1326,1346]
var names = [];
for (var i = -22; i < 0; i++) {
names.push("0"+(""+i).slice(1));
}
for (var i = 1; i < 14; i++) {
names.push(""+i);
}
return cones, names
}
module.format_time = function(now) {