Convert for py3 compatibility

Signed-off-by: Justin Lecher <jlec@gentoo.org>
This commit is contained in:
Justin Lecher 2016-12-27 12:30:44 +00:00
parent 021439191c
commit 638a6f94e6
No known key found for this signature in database
GPG Key ID: E9402A79B03529A2
2 changed files with 6 additions and 6 deletions

2
grc
View File

@ -1,5 +1,7 @@
#! /usr/bin/env python
from __future__ import print_function
import os, re, string, sys, getopt, signal
def version():

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
@ -147,16 +149,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)