"staticdir", "event", "procevent", "startevent",
"finishevent"]
+class error(Exception):
+ pass
+class nosuchname(LookupError, error):
+ pass
+class nosuchproto(error):
+ pass
+
class attrinfo(object):
"""The return value of the `attrinfo' method on `attr' objects as
described in L{pdm.srv.perf}.
import os, sys, socket, threading, grp, select
import types, pprint, traceback
import pickle, struct
+from . import perf as mperf
__all__ = ["repl", "perf", "listener", "unixlistener", "tcplistener", "listen"]
def bindob(self, id, ob):
if not hasattr(ob, "pdm_protocols"):
- raise ValueError("Object does not support PDM introspection")
+ raise mperf.nosuchname("Object does not support PDM introspection")
try:
proto = ob.pdm_protocols()
except Exception as exc:
def bind(self, id, module, obnm):
resmod = sys.modules.get(module)
if resmod is None:
- self.send("-", ImportError("No such module: %s" % module))
+ self.send("-", mperf.nosuchname("No such module: %s" % module))
return
try:
ob = getattr(resmod, obnm)
except AttributeError:
- self.send("-", AttributeError("No such object: %s" % obnm))
+ self.send("-", mperf.nosuchname("No such object: %s" % obnm))
return
try:
proto = self.bindob(id, ob)
return None
ob, protos = ob
if proto not in protos:
- self.send("-", ValueError("Object does not support that protocol"))
+ self.send("-", mperf.nosuchproto("Object does not support that protocol: " + proto))
return None
return ob
try:
ob = src.lookup(obnm)
except KeyError as exc:
- self.send("-", exc)
+ self.send("-", mperf.nosuchname(obnm))
return
try:
proto = self.bindob(tgtid, ob)