Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed several minor bugs

  • Loading branch information...
commit 63a4b1e7bef5472f7186becd46f60df5e4054f9c 1 parent 82db75a
@trey0 trey0 authored
View
8 Client.py
@@ -79,10 +79,10 @@ def makeHumanReadable(self, line):
if line.startswith('#'):
return line
else:
- json = json.loads(line)
- if (json and json[0] == 'response'):
- response, lineId, returnCode = json[:3]
- result = json[3:]
+ cmd = json.loads(line)
+ if (cmd and cmd[0] == 'response'):
+ response, lineId, returnCode = cmd[:3]
+ result = cmd[3:]
if returnCode == 'ok':
return self.makeOkResponseHumanReadable(result[0])
else:
View
1  ConfigHelper.py
@@ -6,7 +6,6 @@
workingDir = '/tmp',
env = {},
log = None,
- host = None,
stopCmd = 'kill -TERM $pid',
stopBackupCmd = 'kill -KILL $pid',
stopBackupDelay = 5)
View
5 Daemon.py
@@ -179,6 +179,7 @@ def dispatchCommand(self, req):
def dispatchCommandParse(self, conn, cmd):
args = parseShellJson(cmd)
+ print 'dispatchCommandParse args=', args
req = Request()
req.conn = conn
if args[0] == 'command':
@@ -210,7 +211,7 @@ def dispatchCommandHandleExceptions(self, conn, cmd):
return None, result
def evalObject(self, val):
- if isinstance(val, str):
+ if isinstance(val, (str, unicode)):
if (val.startswith('"')
or val.startswith("'")):
# quoted string, strip quotes
@@ -303,7 +304,7 @@ def command_del(self, req):
def command_stdin(self, req):
taskName, quotedText = req.args[1:]
- if not (isinstance(quotedText, str) and re.match('".*"', quotedText)):
+ if not (isinstance(quotedText, (str, unicode)) and re.match('".*"', quotedText)):
raise geocamPycroraptor.exceptions.SyntaxError('<text> arg to stdin command must be a quoted string; instead got: %s' % quotedText)
text = quotedText[1:-1]
self.getTask(taskName).writeStdin(text)
View
2  ExpandVariables.py
@@ -31,7 +31,7 @@ def _expandVal0(val, env):
return val
def expandVal(val, env):
- if isinstance(val, str):
+ if isinstance(val, (str, unicode)):
expanded = _expandVal0(val, env)
unescaped = re.sub('00DOLLAR00', '$', expanded)
return unescaped
View
1  examplePycroSettings.py
@@ -9,7 +9,6 @@
LOCAL_DAEMON_STATUS_FILE = '%s/pyraptordStatus.html' % logDir
d = defaultProcessConfig.copy() # abbreviate
-d.cmd = 'python %s/trunk/src/geocam/main/$name.py' % appRoot
d.log = '%s/${name}_${unique}.txt' % logDir
TASKS = ConfigDict()
View
2  shellJson.py
@@ -25,7 +25,7 @@ def parseTerm(s):
except ValueError, err:
raise geocamPycroraptor.exceptions.SyntaxError(*err.args)
else:
- if isinstance(obj, str):
+ if isinstance(obj, (str, unicode)):
# quote the string to retain distinction with bareword
obj = '"%s"' % obj
return obj
Please sign in to comment.
Something went wrong with that request. Please try again.