test pep8
This commit is contained in:
parent
046eeda0d8
commit
da02f8eeb1
@ -1,6 +1,7 @@
|
||||
language: cpp
|
||||
install:
|
||||
- sudo apt-get install g++ cmake gfortran
|
||||
- sudo pip install pytest
|
||||
- sudo pip install pytest pep8
|
||||
script:
|
||||
- pep8 --ignore=E501 update.py
|
||||
- py.test -vv test/test.py
|
||||
|
13
update.py
13
update.py
@ -9,17 +9,16 @@ from collections import OrderedDict
|
||||
# for compatibility with Python < 2.7
|
||||
if sys.version_info[0] > 2:
|
||||
from configparser import RawConfigParser
|
||||
else:
|
||||
from ConfigParser import RawConfigParser
|
||||
|
||||
if sys.version_info[0] > 2:
|
||||
import urllib.request
|
||||
|
||||
class URLopener(urllib.request.FancyURLopener):
|
||||
def http_error_default(self, url, fp, errcode, errmsg, headers):
|
||||
sys.stderr.write("ERROR: could not fetch %s\n" % url)
|
||||
sys.exit(-1)
|
||||
else:
|
||||
from ConfigParser import RawConfigParser
|
||||
import urllib
|
||||
|
||||
class URLopener(urllib.FancyURLopener):
|
||||
def http_error_default(self, url, fp, errcode, errmsg, headers):
|
||||
sys.stderr.write("ERROR: could not fetch %s\n" % url)
|
||||
@ -46,9 +45,9 @@ def print_progress_bar(text, done, total, width):
|
||||
"""
|
||||
Print progress bar.
|
||||
"""
|
||||
n = int(float(width)*float(done)/float(total))
|
||||
sys.stdout.write("\r%s [%s%s] (%i/%i)" % (text, '#'*n,
|
||||
' '*(width-n), done, total))
|
||||
n = int(float(width) * float(done) / float(total))
|
||||
sys.stdout.write("\r%s [%s%s] (%i/%i)" % (text, '#' * n,
|
||||
' ' * (width - n), done, total))
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user