Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ended yaml experiment, stick with json config

  • Loading branch information...
commit 8196fa4b25bea63683cfe60ddf67597c259cca07 1 parent 6ce068c
@trey0 trey0 authored
View
2  geocamPycroraptor2/bin/pyraptord.py
@@ -37,7 +37,7 @@ def main():
parser = optparse.OptionParser('usage: %prog <start|stop|restart|status>')
parser.add_option('-c', '--config',
help='Pycroraptor config file to use [%default]',
- default='pycroraptor.yaml')
+ default='pycroraptor.json')
parser.add_option('-f', '--foreground',
action='store_true', default=False,
help='Run in foreground (do not daemonize)')
View
6 geocamPycroraptor2/bin/pyrterm.py
@@ -10,7 +10,7 @@
from geocamPycroraptor2.shell import Shell
-def pyraptord(opts):
+def pyrterm(opts):
logging.basicConfig(level=logging.DEBUG)
s = Shell(opts.config)
s.run()
@@ -21,13 +21,13 @@ def main():
parser = optparse.OptionParser('usage: %prog')
parser.add_option('-c', '--config',
help='Pycroraptor config file to use [%default]',
- default='pycroraptor.yaml')
+ default='pycroraptor.json')
opts, args = parser.parse_args()
if args:
parser.error('expected no args')
if not opts.config:
parser.error('--config option is required')
- pyraptord(opts)
+ pyrterm(opts)
if __name__ == '__main__':
View
3  geocamPycroraptor2/tests/ports.json
@@ -0,0 +1,3 @@
+{
+ "pyraptord": "tcp://127.0.0.1:9700"
+}
View
1  geocamPycroraptor2/tests/ports.yaml
@@ -1 +0,0 @@
-pyraptord: "tcp://127.0.0.1:9700"
View
13 geocamPycroraptor2/tests/pycroraptor.json
@@ -0,0 +1,13 @@
+{
+ "PORTS": "ports.json",
+ "LOG_DIR": "/tmp/pyraptord/logs",
+
+ "SERVICES": {
+ "bc": {
+ "command": "bc -i"
+ }
+ },
+ "GROUPS": {
+ "startup": ["bc"]
+ }
+}
View
9 geocamPycroraptor2/tests/pycroraptor.yaml
@@ -1,9 +0,0 @@
-PORTS: "ports.yaml"
-LOG_DIR: "/tmp/pyraptord/logs"
-
-SERVICES:
- bc:
- command: "bc -i"
-
-GROUPS:
- startup: ["bc"]
View
8 geocamPycroraptor2/util.py
@@ -9,9 +9,9 @@
import logging
import errno
import time
-import gevent
+import json
-import yaml
+import gevent
from geocamUtil.models.ExtrasDotField import convertToDotDictRecurse
@@ -56,8 +56,8 @@ def debug(self):
def loadConfig(path):
f = open(path, 'r')
- y = yaml.safe_load(f)
- return convertToDotDictRecurse(y)
+ j = json.load(f)
+ return convertToDotDictRecurse(j)
def pidIsActive(pid):
Please sign in to comment.
Something went wrong with that request. Please try again.