Skip to content

Commit

Permalink
fix travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
kviktor committed Jun 18, 2019
1 parent aecbc2c commit b8d874b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ python:

install:
- pip install flake8
- npm install jshint
- npm -g install jshint

script:
- flake8 server/ --max-line-length=85
Expand Down
1 change: 1 addition & 0 deletions server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def db_session():
finally:
session.close()


Base = declarative_base()
Base.query = scoped_session(sessionmaker(autocommit=False,
autoflush=False,
Expand Down
1 change: 1 addition & 0 deletions server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def get_env_variable(name, default=None):
else:
return default


MODEL_DEF_PATH = get_env_variable("MODEL_DEF_PATH")
PRETRAINED_MODEL_PATH = get_env_variable("PRETRAINED_MODEL_PATH")

Expand Down
6 changes: 3 additions & 3 deletions server/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

logger = logging.getLogger(__name__)

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


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

logger.info("Scanning '%s' finished, found the following images: %s",
link, ",".join(images))
Expand Down
2 changes: 1 addition & 1 deletion server/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def home():

@app.route('/get_scores/', methods=['GET', 'POST', ])
def get_scores():
article_urls = request.get_json()
article_urls = request.get_json() or []
key = sha.new("".join(article_urls)).hexdigest()
result = redis_store.get(key)
if not result:
Expand Down

0 comments on commit b8d874b

Please sign in to comment.