[Pymoul-svn] SF.net SVN: pymoul: [299] pymoul/trunk/src/moul/crypt/stream.py
Status: Alpha
Brought to you by:
tiran
|
From: <ti...@us...> - 2007-06-09 06:50:03
|
Revision: 299
http://pymoul.svn.sourceforge.net/pymoul/?rev=299&view=rev
Author: tiran
Date: 2007-06-08 23:49:56 -0700 (Fri, 08 Jun 2007)
Log Message:
-----------
Fixed a bug in the crypt stream read() method. Don't know how the line got in there ... :(
Modified Paths:
--------------
pymoul/trunk/src/moul/crypt/stream.py
Modified: pymoul/trunk/src/moul/crypt/stream.py
===================================================================
--- pymoul/trunk/src/moul/crypt/stream.py 2007-06-01 01:49:57 UTC (rev 298)
+++ pymoul/trunk/src/moul/crypt/stream.py 2007-06-09 06:49:56 UTC (rev 299)
@@ -34,8 +34,10 @@
magic = 12 * '\x00'
blockSize = 1024
- def __init__(self, fdname, cipher):
+ def __init__(self, fdname, cipher, magic=None):
self._cipher = cipher
+ if magic:
+ self.magic = magic
if isinstance(fdname, basestring):
fd = BinaryFile(fdname)
@@ -71,6 +73,7 @@
return self._fd.close()
def read(self):
+ self.seek(0)
fd = self._fd
remain = self._size
bs = self.blockSize
@@ -85,5 +88,4 @@
data = data[:remain]
buf.append(data)
remain -= bs
- remain -= bs
return ''.join(buf)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|