aboutsummaryrefslogtreecommitdiffstats
path: root/minidinstall/SignedFile.py
diff options
context:
space:
mode:
Diffstat (limited to 'minidinstall/SignedFile.py')
-rwxr-xr-xminidinstall/SignedFile.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/minidinstall/SignedFile.py b/minidinstall/SignedFile.py
index 71181c3..efc4730 100755
--- a/minidinstall/SignedFile.py
+++ b/minidinstall/SignedFile.py
@@ -33,7 +33,7 @@ class SignedFile:
line = stream.readline()
if (line == "-----BEGIN PGP SIGNED MESSAGE-----\n"):
self._signed = 1
- while (1):
+ while True:
line = stream.readline()
if (len(line) == 0 or line == '\n'):
break
@@ -55,18 +55,18 @@ class SignedFile:
self._signature = []
self._signatureversion = self._stream.readline()
self._stream.readline() # skip blank line
- while 1:
+ while True:
line = self._stream.readline()
if len(line) == 0 or line == "-----END PGP SIGNATURE-----\n":
break
self._signature.append(line)
- self._signature = string.join
+ self._signature = ''.join(self._signature)
return ''
return line
def readlines(self):
ret = []
- while 1:
+ while True:
line = self.readline()
if (line != ''):
ret.append(line)
@@ -89,19 +89,19 @@ class SignedFile:
if __name__=="__main__":
import sys
if len(sys.argv) == 0:
- print "Need one file as an argument"
+ print("Need one file as an argument")
sys.exit(1)
filename = sys.argv[1]
f=SignedFile(open(filename))
if f.getSigned():
- print "**** SIGNED ****"
+ print("**** SIGNED ****")
else:
- print "**** NOT SIGNED ****"
+ print("**** NOT SIGNED ****")
lines=f.readlines()
- print lines
+ print(lines)
if not f.getSigned():
assert(len(lines) == len(actuallines))
else:
- print "Signature: %s" % (f.getSignature())
+ print("Signature: %s" % (f.getSignature()))
# vim:ts=4:sw=4:et: