Added query string as configurable (Docker) environment variable
This commit is contained in:
@@ -14,6 +14,8 @@ ENV PYTHONDONTWRITEBYTECODE=1
|
|||||||
# the application crashes without emitting any logs due to buffering.
|
# the application crashes without emitting any logs due to buffering.
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
|
ENV ARXIV_QUERY=""
|
||||||
|
|
||||||
# Install required binary packages.
|
# Install required binary packages.
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
|
|||||||
+5
-1
@@ -9,6 +9,7 @@ import time
|
|||||||
import random
|
import random
|
||||||
import logging
|
import logging
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
|
|
||||||
from aslite.arxiv import get_response, parse_response
|
from aslite.arxiv import get_response, parse_response
|
||||||
from aslite.db import get_papers_db, get_metas_db
|
from aslite.db import get_papers_db, get_metas_db
|
||||||
@@ -30,7 +31,10 @@ if __name__ == '__main__':
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# query string of papers to look for
|
# query string of papers to look for
|
||||||
q = 'cat:cs.CV+OR+cat:cs.LG+OR+cat:cs.CL+OR+cat:cs.AI+OR+cat:cs.NE+OR+cat:cs.RO+OR+cat:cs.AR+OR+cat:cs.DC'
|
q = os.environ.get('ARXIV_QUERY', '')
|
||||||
|
if not q:
|
||||||
|
print("No query string provided, will use default.")
|
||||||
|
q = 'cat:cs.CV+OR+cat:cs.LG+OR+cat:cs.CL+OR+cat:cs.AI+OR+cat:cs.NE+OR+cat:cs.RO+OR+cat:cs.AR+OR+cat:cs.DC'
|
||||||
|
|
||||||
pdb = get_papers_db(flag='c')
|
pdb = get_papers_db(flag='c')
|
||||||
mdb = get_metas_db(flag='c')
|
mdb = get_metas_db(flag='c')
|
||||||
|
|||||||
+2
-2
@@ -16,7 +16,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /Users/schihei/git/arxiv-sanity-lite/container-data/data/:/app/data
|
- /Users/schihei/git/arxiv-sanity-lite/container-data/data/:/app/data
|
||||||
- /Users/schihei/git/arxiv-sanity-lite/container-data/static/thumb/:/app/static/thumb
|
- /Users/schihei/git/arxiv-sanity-lite/container-data/static/thumb/:/app/static/thumb
|
||||||
|
environment:
|
||||||
|
- ARXIV_QUERY=cat:cs.CV+OR+cat:cs.LG+OR+cat:cs.CL+OR+cat:cs.AI+OR+cat:cs.NE+OR+cat:cs.RO+OR+cat:cs.AR+OR+cat:cs.DC
|
||||||
# The commented out section below is an example of how to define a PostgreSQL
|
# The commented out section below is an example of how to define a PostgreSQL
|
||||||
# database that your application can use. `depends_on` tells Docker Compose to
|
# database that your application can use. `depends_on` tells Docker Compose to
|
||||||
# start the database before your application. The `db-data` volume persists the
|
# start the database before your application. The `db-data` volume persists the
|
||||||
@@ -49,4 +50,3 @@ services:
|
|||||||
# secrets:
|
# secrets:
|
||||||
# db-password:
|
# db-password:
|
||||||
# file: db/password.txt
|
# file: db/password.txt
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user