diff options
| author | 2018-03-14 02:56:04 +0100 | |
|---|---|---|
| committer | 2018-03-14 20:23:00 -0400 | |
| commit | 23ac25c0b388b5ffebf66154b12a3950b89b977a (patch) | |
| tree | 27ae214e393e6be2efc225d02ffc93135aaa2eb5 /minidinstall/SignedFile.py | |
| parent | 9883708468224628f9e0e577162fb5345fe20eb4 (diff) | |
Port to Python 3
Diffstat (limited to 'minidinstall/SignedFile.py')
| -rwxr-xr-x | minidinstall/SignedFile.py | 18 |
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: |
