Permalink
Browse files

renamed pycroraptor to geocamPycroraptor

  • Loading branch information...
1 parent 86406df commit 2b204e8a195105dbdde175f0263c2a1a54d4fb7e @trey0 trey0 committed Mar 29, 2011
Showing with 63 additions and 63 deletions.
  1. +2 −2 BaseTask.py
  2. +2 −2 Client.py
  3. +1 −1 ConfigDict.py
  4. +2 −2 ConfigHelper.py
  5. +23 −23 Daemon.py
  6. +2 −2 DaemonProxy.py
  7. +3 −3 ExpandVariables.py
  8. +5 −5 LocalTask.py
  9. +1 −1 Log.py
  10. +3 −3 PycroEncoder.py
  11. +3 −3 RemoteTask.py
  12. +2 −2 Slave.py
  13. +2 −2 SubscriberSet.py
  14. +2 −2 commandLineOptions.py
  15. +1 −1 examplePycroSettings.py
  16. +1 −1 pyraptord.py
  17. +1 −1 pyrterm.py
  18. +5 −5 shellJson.py
  19. +2 −2 testProxy.py
View
@@ -1,6 +1,6 @@
-from pycroraptor.Printable import Printable
-from pycroraptor.SubscriberSet import SubscriberSet
+from geocamPycroraptor.Printable import Printable
+from geocamPycroraptor.SubscriberSet import SubscriberSet
class BaseTask(Printable):
def __init__(self, name, parent):
View
@@ -4,8 +4,8 @@
from cStringIO import StringIO
from irgCom.Dispatcher import Dispatcher
from irgCom.SharedScheduler import scheduler, ExitSchedulerLoop
-from pycroraptor import commandLineOptions
-from pycroraptor.DaemonProxy import DaemonProxy
+from geocamPycroraptor import commandLineOptions
+from geocamPycroraptor.DaemonProxy import DaemonProxy
class Client:
def __init__(self, opts=None):
View
@@ -1,5 +1,5 @@
-from pycroraptor.Printable import Printable
+from geocamPycroraptor.Printable import Printable
class ConfigDict(Printable):
def __init__(self, updateDict=None, **kwargs):
View
@@ -1,6 +1,6 @@
-from pycroraptor.Printable import Printable
-from pycroraptor.ConfigDict import ConfigDict
+from geocamPycroraptor.Printable import Printable
+from geocamPycroraptor.ConfigDict import ConfigDict
defaultProcessConfig = ConfigDict(cmd = '$name',
workingDir = '/tmp',
View
@@ -11,17 +11,17 @@
from irgCom.SharedScheduler import scheduler
-from pycroraptor.ConfigDict import ConfigDict
-from pycroraptor.LocalTask import LocalTask
-from pycroraptor.RemoteTask import RemoteTask
-from pycroraptor import ExpandVariables
-from pycroraptor import Log, commandLineOptions
-import pycroraptor.exceptions
-from pycroraptor import settings
-from pycroraptor.shellJson import parseShellJson
-from pycroraptor.signals import SIG_VERBOSE
-from pycroraptor.PycroEncoder import StatusGetter, PycroEncoder
-from pycroraptor.Slave import Slave
+from geocamPycroraptor.ConfigDict import ConfigDict
+from geocamPycroraptor.LocalTask import LocalTask
+from geocamPycroraptor.RemoteTask import RemoteTask
+from geocamPycroraptor import ExpandVariables
+from geocamPycroraptor import Log, commandLineOptions
+import geocamPycroraptor.exceptions
+from geocamPycroraptor import settings
+from geocamPycroraptor.shellJson import parseShellJson
+from geocamPycroraptor.signals import SIG_VERBOSE
+from geocamPycroraptor.PycroEncoder import StatusGetter, PycroEncoder
+from geocamPycroraptor.Slave import Slave
CLEANUP_PERIOD = 0.2
WRITE_STATUS_PERIOD = 5.0
@@ -128,18 +128,18 @@ def getTask(self, taskName):
self._tasks[taskName] = newTask
return self._tasks[taskName]
else:
- raise pycroraptor.exceptions.UnknownTask(taskName)
+ raise geocamPycroraptor.exceptions.UnknownTask(taskName)
def expandGroup1(self, taskOrGroup, tabuList=[]):
if taskOrGroup in tabuList:
- raise pycroraptor.exceptions.GroupContainsItself(taskOrGroup)
+ raise geocamPycroraptor.exceptions.GroupContainsItself(taskOrGroup)
elif self.isGroup(taskOrGroup):
return True, self._env['settings']['groups'][taskOrGroup]
elif (self.isTask(taskOrGroup)
or isinstance(taskOrGroup, (int, float))):
return False, [taskOrGroup]
else:
- raise pycroraptor.exceptions.UnknownTask(taskOrGroup)
+ raise geocamPycroraptor.exceptions.UnknownTask(taskOrGroup)
def expandGroup(self, taskOrGroup, tabuList=[]):
isExpanded, expansionResult = self.expandGroup1(taskOrGroup, tabuList)
@@ -175,7 +175,7 @@ def dispatchCommand(self, req):
daemonLevelHandler = getattr(self, daemonLevelName)
return daemonLevelHandler(req)
else:
- raise pycroraptor.exceptions.UnknownCommand('unknown command "%s"' % cmd)
+ raise geocamPycroraptor.exceptions.UnknownCommand('unknown command "%s"' % cmd)
def dispatchCommandParse(self, conn, cmd):
args = parseShellJson(cmd)
@@ -199,7 +199,7 @@ def dispatchCommandHandleExceptions(self, conn, cmd):
print >>sys.stderr, ('%s.%s: %s' % (errClass.__module__,
errClass.__name__,
str(errObject)))
- if isinstance(errObject, pycroraptor.exceptions.PycroWarning):
+ if isinstance(errObject, geocamPycroraptor.exceptions.PycroWarning):
errLevel = 'warning'
else:
errLevel = 'error'
@@ -223,7 +223,7 @@ def evalObject(self, val):
def command_start(self, req):
if self._shuttingDown:
- raise pycroraptor.exceptions.InvalidCommand("can't run tasks during shutdown")
+ raise geocamPycroraptor.exceptions.InvalidCommand("can't run tasks during shutdown")
taskArgs = req.args[1:]
if taskArgs and isinstance(taskArgs[-1], dict):
params = taskArgs.pop(-1)
@@ -240,7 +240,7 @@ def command_start(self, req):
msg = 'task %s already running' % tasks[0].name
else:
msg = 'all tasks already running'
- raise pycroraptor.exceptions.NothingToDo(msg)
+ raise geocamPycroraptor.exceptions.NothingToDo(msg)
def command_run(self, req):
"""run is an alias for start"""
@@ -263,7 +263,7 @@ def command_stop(self, req):
msg = 'task %s not running' % tasks[0].name
else:
msg = 'all tasks already stopped'
- raise pycroraptor.exceptions.NothingToDo(msg)
+ raise geocamPycroraptor.exceptions.NothingToDo(msg)
def command_kill(self, req):
"""kill is an alias for stop"""
@@ -304,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)):
- raise pycroraptor.exceptions.SyntaxError('<text> arg to stdin command must be a quoted string; instead got: %s' % 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)
@@ -343,7 +343,7 @@ def command_sub(self, req):
if req.args[1] == 'status':
return self.commandSubStatus(req)
else:
- raise pycroraptor.exceptions.SyntaxError('expected "status" after "sub"')
+ raise geocamPycroraptor.exceptions.SyntaxError('expected "status" after "sub"')
def commandUnsubStatus(self, req):
tasks = self.getTasks(req.args[2:])
@@ -355,7 +355,7 @@ def command_unsub(self, req):
if req.args[1] == 'status':
return self.commandUnsubStatus(req)
else:
- raise pycroraptor.exceptions.SyntaxError('expected "status" after "unsub"')
+ raise geocamPycroraptor.exceptions.SyntaxError('expected "status" after "unsub"')
def commandHandler(self, conn, cmd):
if self._opts.logComm:
@@ -546,7 +546,7 @@ def start(self):
print 'running tasks in startup group "%s"' % self._opts.startupGroup
try:
startupTasks = self.expandGroup(self._opts.startupGroup)
- except pycroraptor.exceptions.UnknownTask, err:
+ except geocamPycroraptor.exceptions.UnknownTask, err:
print >>sys.stderr, ('could not run startup group "%s": %s'
% (self._opts.startupGroup, err))
else:
View
@@ -3,8 +3,8 @@
import simplejson
from irgCom.SharedScheduler import scheduler
from irgCom.Dispatcher import Dispatcher
-from pycroraptor import commandLineOptions
-from pycroraptor.Printable import Printable
+from geocamPycroraptor import commandLineOptions
+from geocamPycroraptor.Printable import Printable
class DaemonProxy:
"""Example usage: p = DaemonProxy(); p.start('bc')"""
View
@@ -1,8 +1,8 @@
import re, time
from string import Template
-from pycroraptor.ShadowDict import ShadowDict
-import pycroraptor.exceptions
+from geocamPycroraptor.ShadowDict import ShadowDict
+import geocamPycroraptor.exceptions
def camelCase(s):
# FOO_BAR -> fooBar
@@ -54,7 +54,7 @@ def _dotLookup(key, env, write):
except KeyError:
raise KeyError(key)
if write and not writable:
- raise pycroraptor.exceptions.ImmutableObject(key)
+ raise geocamPycroraptor.exceptions.ImmutableObject(key)
return namespace, allElts[-1]
def getVariable(key, env):
View
@@ -12,11 +12,11 @@
from irgCom.SharedScheduler import scheduler
-from pycroraptor.ExpandVariables import expandVal
-from pycroraptor import Log
-from pycroraptor.Stdout import Stdout
-from pycroraptor.signals import SIG_VERBOSE
-from pycroraptor.BaseTask import BaseTask
+from geocamPycroraptor.ExpandVariables import expandVal
+from geocamPycroraptor import Log
+from geocamPycroraptor.Stdout import Stdout
+from geocamPycroraptor.signals import SIG_VERBOSE
+from geocamPycroraptor.BaseTask import BaseTask
class LocalTask(BaseTask):
def __init__(self, name, parent):
View
@@ -2,7 +2,7 @@
import os
import datetime
import re
-from pycroraptor.ExpandVariables import expandVal
+from geocamPycroraptor.ExpandVariables import expandVal
UNIQUE_REGEX = r'\$\{unique\}|\$unique\b'
View
@@ -1,16 +1,16 @@
import simplejson
-from pycroraptor.ConfigDict import ConfigDict
-import pycroraptor.exceptions
+from geocamPycroraptor.ConfigDict import ConfigDict
+import geocamPycroraptor.exceptions
class StatusGetter:
def __init__(self, daemon):
self._daemon = daemon
def __getitem__(self, taskName):
return self._daemon.getTask(taskName).status
def __setitem__(self, taskName, val):
- raise pycroraptor.exceptions.ImmutableObject('task status is immutable')
+ raise geocamPycroraptor.exceptions.ImmutableObject('task status is immutable')
def asDict(self):
allSettings = self._daemon._env['settings']
allTaskSettings = allSettings['tasks']
View
@@ -2,9 +2,9 @@
import os
import sys
-from pycroraptor.Printable import Printable
-from pycroraptor.SubscriberSet import SubscriberSet
-from pycroraptor.BaseTask import BaseTask
+from geocamPycroraptor.Printable import Printable
+from geocamPycroraptor.SubscriberSet import SubscriberSet
+from geocamPycroraptor.BaseTask import BaseTask
class RemoteTask(BaseTask):
def __init__(self, name, parent, slave):
View
@@ -3,8 +3,8 @@
import simplejson
-from pycroraptor.Printable import Printable
-from pycroraptor.PycroEncoder import PycroEncoder
+from geocamPycroraptor.Printable import Printable
+from geocamPycroraptor.PycroEncoder import PycroEncoder
class Slave(Printable):
def __init__(self, name, endpoint, dispatcher, logComm=True, statusHandler=None):
View
@@ -3,8 +3,8 @@
from irgCom.WeakSet import WeakSet
-from pycroraptor.PycroEncoder import PycroEncoder
-from pycroraptor.printTraceback import printTraceback
+from geocamPycroraptor.PycroEncoder import PycroEncoder
+from geocamPycroraptor.printTraceback import printTraceback
class SubscriberSet(WeakSet):
def write(self, obj):
@@ -2,7 +2,7 @@
import os, optparse, imp
import re
import platform
-from pycroraptor import settings
+from geocamPycroraptor import settings
DEFAULT_SETTINGS_FILE = os.environ.get('PYCRORAPTOR_SETTINGS_FILE', None)
DEFAULT_ENDPOINT = os.environ.get('PYCRORAPTOR_ENDPOINT', 'tcp:localhost:8085')
@@ -30,7 +30,7 @@ def getOptParser():
def readSettings(settingsFileName):
if not os.path.lexists(settingsFileName):
raise IOError('settings file "%s" does not exist' % settingsFileName)
- userSettings = imp.load_source('pycroraptor.userSettings', settingsFileName)
+ userSettings = imp.load_source('geocamPycroraptor.userSettings', settingsFileName)
for k, v in vars(userSettings).iteritems():
setattr(settings, k, v)
@@ -1,6 +1,6 @@
import os
-from pycroraptor.ConfigHelper import ConfigDict, defaultProcessConfig
+from geocamPycroraptor.ConfigHelper import ConfigDict, defaultProcessConfig
logDir = '/tmp/pyraptord/logs'
View
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import sys
-from pycroraptor.Daemon import Daemon
+from geocamPycroraptor.Daemon import Daemon
if __name__ == "__main__":
Daemon.run(sys.argv)
View
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import sys
-from pycroraptor.Client import Client
+from geocamPycroraptor.Client import Client
if __name__ == "__main__":
Client.run(sys.argv)
View
@@ -1,6 +1,6 @@
import re, simplejson
-import pycroraptor.exceptions
+import geocamPycroraptor.exceptions
JSON_RESERVED_WORDS = dict.fromkeys(['null'])
@@ -22,7 +22,7 @@ def parseTerm(s):
try:
obj = simplejson.loads(s)
except ValueError, err:
- raise pycroraptor.exceptions.SyntaxError(*err.args)
+ raise geocamPycroraptor.exceptions.SyntaxError(*err.args)
else:
if isinstance(obj, str):
# quote the string to retain distinction with bareword
@@ -36,7 +36,7 @@ def parseShellJsonShell(cmd):
while True:
try:
parsedHead = parseTerm(head)
- except pycroraptor.exceptions.SyntaxError:
+ except geocamPycroraptor.exceptions.SyntaxError:
if cmd:
head2, wspace2, cmd = trisplit(cmd)
head = head + wspace + head2
@@ -52,7 +52,7 @@ def parseShellJsonStrict(cmd):
try:
return simplejson.loads(cmd)
except ValueError, err:
- raise pycroraptor.exceptions.SyntaxError(*err.args)
+ raise geocamPycroraptor.exceptions.SyntaxError(*err.args)
def parseShellJson(cmd):
cmd = cmd.strip()
@@ -72,7 +72,7 @@ def parseShellJson(cmd):
print parseShellJson('kill -a')
try:
print parseShellJson('foo {"zoo":')
- except pycroraptor.exceptions.SyntaxError:
+ except geocamPycroraptor.exceptions.SyntaxError:
print 'last call raised error as expected'
else:
print 'oops, how did that parse?'
View
@@ -5,8 +5,8 @@
# the tester may still be useful.
import os
-from pycroraptor.DaemonProxy import DaemonProxy
-from pycroraptor import commandLineOptions
+from geocamPycroraptor.DaemonProxy import DaemonProxy
+from geocamPycroraptor import commandLineOptions
def handleLine(sock, line):
print 'testProxy: line =', line

0 comments on commit 2b204e8

Please sign in to comment.