Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit acc7e0b

Browse files
committed
Travis: Use flake8 and correct flake8 warnings.
1 parent 1b3aabb commit acc7e0b

8 files changed

+11
-18
lines changed

.travis-script-2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ set -x -e # Show commands being executed and exit nonzero upon errors.
55
./python2.7/mt.py --help
66

77
for F in python2.7/*; do
8-
pep8 --ignore=E402,E501 $F
8+
flake8 --ignore=E402,E501 $F
99
done

.travis-script-3.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ set -x -e # Show commands being executed and exit nonzero upon errors.
1313
./python3/merge-mutt-contacts.py --help
1414

1515
for F in generate-readme.py python3/*; do
16-
pep8 --ignore=E402,E501 $F
16+
flake8 --ignore=E402,E501 $F
1717
done

python2.7/caffe-compute-image-mean.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import os
1616
import time
1717

18-
from caffe.proto import caffe_pb2
1918
from caffe.io import array_to_blobproto
2019
from collections import defaultdict
2120
from skimage import io

python2.7/fix-music-tags.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
def fixTags(fname, keep):
1616
audio = EasyID3(fname)
17-
artist = audio['artist']
18-
title = audio['title']
19-
album = audio['album']
2017

2118
delKeys = []
2219
for k, v in audio.items():

python3/github-repo-summary.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from github import Github
1111
import argparse
12-
import time
1312
import os
1413
import sys
1514

@@ -30,8 +29,7 @@ def sanitize_for_md(s):
3029
try:
3130
r = github.get_repo(r_name)
3231
except:
33-
print("Error: Repository '{}' not found.".format(r_name),
34-
file=sys.stderr)
32+
sys.stderr.write("Error: Repository '{}' not found.\n".format(r_name))
3533
sys.exit(-1)
3634
content = " | ".join([
3735
"[{}]({})".format(r.full_name, r.html_url),

python3/link-checker.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
# Settings to send emails with SMTP with gmail.
2222
server = "smtp.gmail.com"
2323
port = 587
24-
user = ENTER_USER
25-
pw = ENTER_PW # Please use an application-specific password for security!
26-
email_to = ENTER_TO_EMAIL
27-
email_from = ENTER_FROM_EMAIL
28-
root_url = ENTER_URL
24+
user = 'ENTER_USER'
25+
pw = 'ENTER_PW' # Please use an application-specific password for security!
26+
email_to = 'ENTER_TO_EMAIL'
27+
email_from = 'ENTER_FROM_EMAIL'
28+
root_url = 'ENTER_URL'
2929

3030
cmd = ["linkchecker", "--no-warnings", "--no-status", "--external", root_url]
3131
output = Popen(cmd, stdout=PIPE).communicate()[0].decode("UTF-8")

python3/merge-pdfs-printable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
import argparse
3939
import os
40-
import re
4140
import subprocess
4241
import tempfile
4342

@@ -87,7 +86,7 @@ def merge_pdfs(f_names):
8786
out_file = "merged.pdf" # tempfile.mktemp("-merge.pdf")
8887
with open(out_file, 'wb') as f:
8988
merger.write(f)
90-
[f.close() for f in fps]
89+
[fp.close() for fp in fps]
9190
print("Merged output is in '{}'.".format(out_file))
9291

9392
if __name__ == '__main__':

python3/remove-duplicates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import hashlib
1414
import imagehash
1515
import os
16-
import sys
1716

1817
from collections import defaultdict
1918
from PIL import Image
@@ -27,7 +26,8 @@ def getImgs(d):
2726
for subdir, dirs, files in os.walk(d):
2827
imgs = []
2928
for fName in files:
30-
(imageClass, imageName) = (os.path.basename(subdir), fName)
29+
# (imageClass, imageName) = (os.path.basename(subdir), fName)
30+
imageName = fName
3131
if any(imageName.lower().endswith("." + ext) for ext in exts):
3232
imgs.append(os.path.join(subdir, fName))
3333
imgClasses.append(imgs)

0 commit comments

Comments
 (0)