kopia lustrzana https://github.com/botheredbybees/kilnController
some pep8 tidying
rodzic
2872d5d426
commit
32da13412f
|
@ -16,8 +16,8 @@ try:
|
|||
import config
|
||||
sys.dont_write_bytecode = False
|
||||
except:
|
||||
print "Could not import config file."
|
||||
print "Copy config.py.EXAMPLE to config.py and adapt it for your setup."
|
||||
print("Could not import config file.")
|
||||
print("Copy config.py.EXAMPLE to config.py and adapt it for your setup.")
|
||||
exit(1)
|
||||
|
||||
logging.basicConfig(level=config.log_level, format=config.log_format)
|
||||
|
@ -27,7 +27,6 @@ log.info("Starting kilncontrollerd")
|
|||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
sys.path.insert(0, script_dir + '/lib/')
|
||||
profile_path = os.path.join(script_dir, "storage", "profiles")
|
||||
|
||||
from oven import Oven, Profile
|
||||
from ovenWatcher import OvenWatcher
|
||||
|
||||
|
@ -44,7 +43,9 @@ def index():
|
|||
@app.route('/kilncontroller/:filename#.*#')
|
||||
def send_static(filename):
|
||||
log.debug("serving %s" % filename)
|
||||
return bottle.static_file(filename, root=os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "public"))
|
||||
return bottle.static_file(filename,
|
||||
root=os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
|
||||
"public"))
|
||||
|
||||
|
||||
def get_websocket_from_request():
|
||||
|
@ -188,8 +189,9 @@ def save_profile(profile, force=False):
|
|||
log.info("Wrote %s" % filepath)
|
||||
return True
|
||||
|
||||
|
||||
def delete_profile(profile):
|
||||
profile_json = json.dumps(profile)
|
||||
# profile_json = json.dumps(profile)
|
||||
filename = profile['name'] + ".json"
|
||||
filepath = os.path.join(profile_path, filename)
|
||||
os.remove(filepath)
|
||||
|
|
Ładowanie…
Reference in New Issue