add Python3 compatibility

pull/1052/head
Alexandre Detiste 8 months ago committed by Alex Willmer
parent 933477fcbe
commit 58235e3675

@ -6,6 +6,7 @@
# - apt-get source libpam0g # - apt-get source libpam0g
# - cd */po/ # - cd */po/
# - python ~/pogrep.py "Password: " # - python ~/pogrep.py "Password: "
from __future__ import print_function
import sys import sys
import shlex import shlex
@ -31,7 +32,7 @@ for path in glob.glob('*.po'):
if last_word == 'msgid' and word == 'msgstr': if last_word == 'msgid' and word == 'msgstr':
if last_rest == sys.argv[1]: if last_rest == sys.argv[1]:
thing = rest.rstrip(': ').decode('utf-8').lower().encode('utf-8').encode('base64').rstrip() thing = rest.rstrip(': ').decode('utf-8').lower().encode('utf-8').encode('base64').rstrip()
print ' %-60s # %s' % (repr(thing)+',', path) print(' %-60s # %s' % (repr(thing)+',', path))
last_word = word last_word = word
last_rest = rest last_rest = rest

Loading…
Cancel
Save