python: cleanup with autopep8
* tests/python/341.py, tests/python/alarm.py, tests/python/bdddict.py, tests/python/bddnqueen.py, tests/python/bugdet.py, tests/python/dualize.py, tests/python/except.py, tests/python/gen.py, tests/python/genem.py, tests/python/implies.py, tests/python/interdep.py, tests/python/ipnbdoctest.py, tests/python/kripke.py, tests/python/ltl2tgba.py, tests/python/ltlf.py, tests/python/ltlparse.py, tests/python/ltlsimple.py, tests/python/relabel.py, tests/python/rs_like.py, tests/python/sccsplit.py, tests/python/semidet.py, tests/python/setacc.py, tests/python/setxor.py, tests/python/split.py, tests/python/streett_totgba.py, tests/python/stutter.py, tests/python/sum.py, tests/python/toparity.py, tests/python/toweak.py, tests/python/trival.py, python/spot/__init__.py, python/spot/aux.py, python/spot/jupyter.py: Reformat with autopep8. fixup! * spot/tl/simplify.cc: Fix typos in tracing code.
This commit is contained in:
parent
5b01ce32dd
commit
822fe77891
33 changed files with 444 additions and 356 deletions
|
|
@ -12,7 +12,9 @@ with those stored in the notebook.
|
|||
|
||||
from __future__ import print_function
|
||||
|
||||
import os,sys,time
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import base64
|
||||
import re
|
||||
import pprint
|
||||
|
|
@ -40,7 +42,7 @@ except ImportError:
|
|||
except ImportError:
|
||||
try:
|
||||
from IPython.zmq.blockingkernelmanager \
|
||||
import BlockingKernelManager as KernelManager
|
||||
import BlockingKernelManager as KernelManager
|
||||
except:
|
||||
print('IPython is needed to run this script.')
|
||||
sys.exit(77)
|
||||
|
|
@ -51,6 +53,7 @@ try:
|
|||
except ImportError:
|
||||
from IPython.nbformat import v4 as nbformat
|
||||
|
||||
|
||||
def compare_png(a64, b64):
|
||||
"""compare two b64 PNGs (incomplete)"""
|
||||
try:
|
||||
|
|
@ -61,6 +64,7 @@ def compare_png(a64, b64):
|
|||
bdata = base64.decodestring(b64)
|
||||
return True
|
||||
|
||||
|
||||
def canonicalize(s, type, ignores):
|
||||
"""sanitize a string for comparison.
|
||||
|
||||
|
|
@ -163,8 +167,8 @@ def canonical_dict(dict, ignores):
|
|||
if 'ename' in dict and dict['ename'] == 'CalledProcessError':
|
||||
# CalledProcessError message has a final dot in Python 3.6
|
||||
dict['evalue'] = \
|
||||
re.sub(r"(' returned non-zero exit status \d+)\.", r'\1',
|
||||
dict['evalue'])
|
||||
re.sub(r"(' returned non-zero exit status \d+)\.", r'\1',
|
||||
dict['evalue'])
|
||||
|
||||
if 'transient' in dict:
|
||||
del dict['transient']
|
||||
|
|
@ -195,6 +199,7 @@ def compare_outputs(ref, test, ignores=[]):
|
|||
fromfile='expected', tofile='effective')))
|
||||
return False
|
||||
|
||||
|
||||
def _wait_for_ready_backport(kc):
|
||||
"""Backport BlockingKernelClient.wait_for_ready from IPython 3"""
|
||||
# Wait for kernel info reply on shell channel
|
||||
|
|
@ -210,6 +215,7 @@ def _wait_for_ready_backport(kc):
|
|||
except Empty:
|
||||
break
|
||||
|
||||
|
||||
def run_cell(kc, cell):
|
||||
kc.execute(cell.source)
|
||||
# wait for finish, maximum 30s
|
||||
|
|
@ -295,7 +301,6 @@ def test_notebook(ipynb):
|
|||
print("OK")
|
||||
successes += 1
|
||||
|
||||
|
||||
print("tested notebook %s" % ipynb)
|
||||
print(" %3i cells successfully replicated" % successes)
|
||||
if failures:
|
||||
|
|
@ -308,6 +313,7 @@ def test_notebook(ipynb):
|
|||
if failures | errors:
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
for ipynb in sys.argv[1:]:
|
||||
print("testing %s" % ipynb)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue