This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d07f1f6
commit e0b56c3
Showing
25 changed files
with
67 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,7 @@ var | |
sdist | ||
develop-eggs | ||
.installed.cfg | ||
tdtool.py | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
host = 127.0.0.1 | ||
port = 8080 | ||
dll_path = "" | ||
debug = False | ||
editable = False | ||
client_name = TellProx | ||
client_id = 1 |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
if sys.version_info < (2, 5): | ||
print "Sorry, requires Python 2.5, 2.6 or 2.7." | ||
sys.exit(1) | ||
|
||
import tellstick_api | ||
import json | ||
|
||
from bottle import * | ||
from configobj import ConfigObj | ||
from validate import Validator | ||
|
||
# Constants | ||
CONFIG_PATH = 'config.ini' | ||
CONFIG_SPEC = 'configspec.ini' | ||
|
||
app = Bottle() | ||
|
||
# TODO wrap using virtualenv / py2exe | ||
def main(): | ||
config = ConfigObj(CONFIG_PATH, configspec=CONFIG_SPEC) | ||
validator = Validator() | ||
result = config.validate(validator, copy=True) | ||
|
||
if result is False: | ||
print "Config file validation failed" | ||
sys.exit(1) | ||
|
||
# Write out default values | ||
config.write() | ||
|
||
tellstick_api.set_config(config) | ||
app.mount('/json', tellstick_api.app) | ||
|
||
debug(config['debug']) | ||
run(app, | ||
host = config['host'], | ||
port = config['port'], | ||
reloader = config['debug']) | ||
|
||
@app.route('/') | ||
def server_static(): | ||
return static_file('index.html', root='.') | ||
|
||
@app.route('/example.html') | ||
def server_static(): | ||
return static_file('example.html', root='.') | ||
|
||
@app.route('/static/<filepath:path>') | ||
def server_static(filepath='index.html'): | ||
return static_file(filepath, root='./static') | ||
|
||
if __name__ == "__main__": | ||
main() |
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters