Dolda2000 GitWeb
/
pdm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Include perfclient in pdm.cli's exports.
[pdm.git]
/
pdm
/
cli.py
diff --git
a/pdm/cli.py
b/pdm/cli.py
index
da6bcc5
..
65d5a89
100644
(file)
--- a/
pdm/cli.py
+++ b/
pdm/cli.py
@@
-6,7
+6,7
@@
provided in the pdm.srv module.
import socket, pickle, struct, select, threading
import socket, pickle, struct, select, threading
-__all__ = ["client", "replclient"]
+__all__ = ["client", "replclient"
, "perfclient"
]
class protoerr(Exception):
pass
class protoerr(Exception):
pass
@@
-47,6
+47,9
@@
class client(object):
def close(self):
self.sk.close()
def close(self):
self.sk.close()
+ def fileno(self):
+ return self.sk.fileno()
+
def readline(self):
while True:
p = self.buf.find("\n")
def readline(self):
while True:
p = self.buf.find("\n")
@@
-136,7
+139,7
@@
class perfproxy(object):
self.cl.run("subs", self.id)
self.subscribers.add(cb)
self.cl.run("subs", self.id)
self.subscribers.add(cb)
- def unsubscribe(self):
+ def unsubscribe(self
, cb
):
if cb not in self.subscribers:
raise ValueError("Not subscribed")
self.subscribers.remove(cb)
if cb not in self.subscribers:
raise ValueError("Not subscribed")
self.subscribers.remove(cb)
@@
-150,8
+153,13
@@
class perfproxy(object):
except: pass
def close(self):
except: pass
def close(self):
- self.cl.run("unbind", self.id)
- del self.cl.proxies[self.id]
+ if self.id is not None:
+ self.cl.run("unbind", self.id)
+ del self.cl.proxies[self.id]
+ self.id = None
+
+ def __del__(self):
+ self.close()
def __enter__(self):
return self
def __enter__(self):
return self