Skip to content

Commit b8d874b

Browse files
committed
fix travis build
1 parent aecbc2c commit b8d874b

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ python:
44

55
install:
66
- pip install flake8
7-
- npm install jshint
7+
- npm -g install jshint
88

99
script:
1010
- flake8 server/ --max-line-length=85

server/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def db_session():
2323
finally:
2424
session.close()
2525

26+
2627
Base = declarative_base()
2728
Base.query = scoped_session(sessionmaker(autocommit=False,
2829
autoflush=False,

server/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def get_env_variable(name, default=None):
1010
else:
1111
return default
1212

13+
1314
MODEL_DEF_PATH = get_env_variable("MODEL_DEF_PATH")
1415
PRETRAINED_MODEL_PATH = get_env_variable("PRETRAINED_MODEL_PATH")
1516

server/tasks.py

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

1515
logger = logging.getLogger(__name__)
1616

17-
TWITTER_RE = re.compile(".+>([a-zA-Z0-9\./]+)<.+")
17+
TWITTER_RE = re.compile(".+>([a-zA-Z0-9./]+)<.+")
1818
INSTAGRAM_API = "https://api.instagram.com/oembed/?callback=&url=%s"
1919

2020

@@ -101,8 +101,8 @@ def img_and_not_szerzo(tag):
101101
for f in [extract_instagram_urls, extract_twitter_urls, ]:
102102
try:
103103
images.extend(f(soup, link))
104-
except:
105-
logger.error("Error calling '%s' with '%s'", f, link)
104+
except Exception:
105+
logger.exception("Error calling '%s' with '%s'", f, link)
106106

107107
logger.info("Scanning '%s' finished, found the following images: %s",
108108
link, ",".join(images))

server/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def home():
2121

2222
@app.route('/get_scores/', methods=['GET', 'POST', ])
2323
def get_scores():
24-
article_urls = request.get_json()
24+
article_urls = request.get_json() or []
2525
key = sha.new("".join(article_urls)).hexdigest()
2626
result = redis_store.get(key)
2727
if not result:

0 commit comments

Comments
 (0)