-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a config.json file and integrated it with the program
- Loading branch information
Alexander James Wallar
committed
Feb 7, 2014
1 parent
48bb322
commit b2265ce
Showing
11 changed files
with
92 additions
and
75 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
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,10 @@ | ||
|
||
{ | ||
"jvm_path": "/System/Library/Frameworks/JavaVM.framework/JavaVM", | ||
"db_host": "localhost", | ||
"db_port": 28015, | ||
"max_node_events": 10, | ||
"min_confidence": 0.3, | ||
"debug_mode": true | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
|
||
import json | ||
import sys | ||
|
||
from flask import Flask | ||
import db | ||
|
||
app = Flask(__name__) | ||
app.config.from_object(__name__) | ||
|
||
detection_events = dict() | ||
new_data = dict() | ||
|
||
# So the routes get initiated | ||
import detectionserver | ||
import pageserver | ||
|
||
|
||
def run(host, port): | ||
""" | ||
Runs the server. | ||
@param host The host for the server | ||
@param port The port for the server | ||
this = sys.modules[__name__] | ||
|
||
""" | ||
# setting default values | ||
jvm_path = "/System/Library/Frameworks/JavaVM.framework/JavaVM" | ||
db_host = "localhost" | ||
db_port = 28015 | ||
max_node_events = 10 | ||
min_confidence = 0.3 | ||
debug_mode = True | ||
|
||
db.init() | ||
app.run(host=host, port=int(port), debug=True) | ||
|
||
def load_config_file(filename): | ||
global this | ||
with open(filename) as f: | ||
config_dict = json.loads(f.read()) | ||
for config_key, config_value in config_dict.items(): | ||
setattr(this, config_key, config_value) | ||
|
||
|
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
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
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
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