/usr/lib/python3/dist-packages/pgpdump/__main__.py is in python3-pgpdump 1.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | import sys
from . import AsciiData, BinaryData
def parsefile(name):
with open(name, 'rb') as infile:
if name.endswith('.asc') or name.endswith('.txt'):
data = AsciiData(infile.read())
else:
data = BinaryData(infile.read())
for packet in data.packets():
yield packet
def main():
counter = length = 0
for filename in sys.argv[1:]:
for packet in parsefile(filename):
counter += 1
length += packet.length
print('%d packets, length %d' % (counter, length))
if __name__ == '__main__':
#import cProfile
#cProfile.run('main()', 'pgpdump.profile')
main()
|