Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add support for read() (without arguments) to comm_curl

  • Loading branch information...
commit 4b31f71372dd11b48be6e19b1a60b914172baf9e 1 parent 732119f
Ville Tuulos authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 pydisco/disco/comm_curl.py
View
12 pydisco/disco/comm_curl.py
@@ -131,9 +131,15 @@ def write(self, buf):
self.body = True
self.buf += buf
- def read(self, bytes):
- while len(self.buf) < bytes and self.cont:
- self.perform()
+ def read(self, bytes = None):
+ if bytes == None:
+ while self.cont:
+ self.perform()
+ bytes = len(self.buf)
+ else:
+ while len(self.buf) < bytes and self.cont:
+ self.perform()
+
r = self.buf[:bytes]
self.buf = self.buf[bytes:]
return r
Please sign in to comment.
Something went wrong with that request. Please try again.