summaryrefslogtreecommitdiff
path: root/paramiko/ber.py
diff options
context:
space:
mode:
authorScott Maxwell <scott@codecobblers.com>2014-03-07 20:45:26 -0800
committerScott Maxwell <scott@codecobblers.com>2014-03-07 20:45:26 -0800
commitf0017b83309899bf6fffc0fa90093c36f1a7f7ea (patch)
tree582d35dee4b32f022bddc2245731a76112f7ac8e /paramiko/ber.py
parent073c71a8223ff77cacd8c555ef63ce24f0c3d50c (diff)
downloadparamiko-f0017b83309899bf6fffc0fa90093c36f1a7f7ea.tar.gz
Fix import * and a bunch of PEP8 formatting
Diffstat (limited to 'paramiko/ber.py')
-rw-r--r--paramiko/ber.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/paramiko/ber.py b/paramiko/ber.py
index c4f35210..05152303 100644
--- a/paramiko/ber.py
+++ b/paramiko/ber.py
@@ -15,10 +15,10 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-
+from paramiko.common import max_byte, zero_byte
+from paramiko.py3compat import b, byte_ord, byte_chr, long
import paramiko.util as util
-from paramiko.common import *
class BERException (Exception):
@@ -71,12 +71,12 @@ class BER(object):
t = size & 0x7f
if self.idx + t > len(self.content):
return None
- size = util.inflate_long(self.content[self.idx : self.idx + t], True)
+ size = util.inflate_long(self.content[self.idx: self.idx + t], True)
self.idx += t
if self.idx + size > len(self.content):
# can't fit
return None
- data = self.content[self.idx : self.idx + size]
+ data = self.content[self.idx: self.idx + size]
self.idx += size
# now switch on id
if ident == 0x30:
@@ -91,9 +91,9 @@ class BER(object):
def decode_sequence(data):
out = []
- b = BER(data)
+ ber = BER(data)
while True:
- x = b.decode_next()
+ x = ber.decode_next()
if x is None:
break
out.append(x)
@@ -126,8 +126,8 @@ class BER(object):
raise BERException('Unknown type for encoding: %s' % repr(type(x)))
def encode_sequence(data):
- b = BER()
+ ber = BER()
for item in data:
- b.encode(item)
- return b.asbytes()
+ ber.encode(item)
+ return ber.asbytes()
encode_sequence = staticmethod(encode_sequence)