Merge pull request #45 from jlec/py3

Convert for py3 compatibility
This commit is contained in:
Radovan Garabík 2017-01-05 16:41:19 +01:00 committed by GitHub
commit f5680f91c6
2 changed files with 6 additions and 6 deletions

2
grc
View File

@ -1,5 +1,7 @@
#! /usr/bin/env python3
from __future__ import print_function
import os, re, string, sys, getopt, signal

10
grcat
View File

@ -1,5 +1,7 @@
#! /usr/bin/env python
from __future__ import print_function
import sys, os, string, re, signal, errno
#some default definitions
@ -161,16 +163,12 @@ while not is_last:
# do not try to understand the optimized form below :-)
if 'colours' in ll:
colstrings = list(
map(
lambda colgroup:
''.join(map(lambda x: get_colour(x), split(colgroup))),
split(ll['colours'], ',')
)
[''.join([get_colour(x) for x in split(colgroup)]) for colgroup in split(ll['colours'], ',')]
)
ll['colours'] = colstrings
cs = ll['count']
if ll.has_key('regexp'):
if 'regexp' in ll:
ll['regexp'] = re.compile(ll['regexp']).search
regexplist.append(ll)