Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Steinlechner
pykat
Commits
3543e7d7
Commit
3543e7d7
authored
Apr 22, 2015
by
Andreas Freise
Browse files
fixing some python2/3 errors
parent
8a1ff3f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
pykat/finesse.py
View file @
3543e7d7
...
...
@@ -47,7 +47,6 @@ import collections
import
re
import
copy
try
:
# Python 2
from
itertools
import
izip_longest
...
...
@@ -1074,9 +1073,7 @@ class kat(object):
if
len
(
line
)
>
0
:
# remove any ANSI commands
#ansi = re.compile(r'\x1b[^m]*m')
#line = ansi.sub('', line)
line
=
re
.
sub
(
br
'\x1b[^m]*m'
,
''
,
line
,
re
.
UNICODE
)
line
=
re
.
sub
(
br
'\x1b[^m]*m'
,
b
''
,
line
,
re
.
UNICODE
)
# warnings and errors start with an asterisk
# so if verbose show them
...
...
@@ -1100,7 +1097,7 @@ class kat(object):
sys
.
stdout
.
write
(
str
(
line
,
'utf-8'
))
elif
line
.
rstrip
().
endswith
(
b
'%'
):
vals
=
line
.
split
(
"-"
)
vals
=
line
.
split
(
b
'-'
)
action
=
vals
[
0
].
strip
()
prc
=
vals
[
1
].
strip
()[:]
...
...
@@ -1123,8 +1120,10 @@ class kat(object):
for
line
in
_out
[::
-
1
]:
if
line
.
lstrip
().
startswith
(
'computation time:'
):
r
.
runtime
=
float
(
line
.
split
(
":"
)[
1
].
replace
(
"s"
,
""
))
try
:
r
.
runtime
=
float
(
line
.
split
(
":"
)[
1
].
replace
(
"s"
,
""
))
except
:
r
.
runtime
=
0.0
if
printout
==
1
:
print
(
out
)
else
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment