Skip to content

Commit

Permalink
test pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
bast committed Jun 26, 2015
1 parent 046eeda commit da02f8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 6 additions & 7 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
# 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)
Expand All @@ -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()


Expand Down

0 comments on commit da02f8e

Please sign in to comment.