added namings to feeds
This commit is contained in:
parent
de5b3ad932
commit
4cc4e7922e
@ -48,7 +48,7 @@ def _start_scheduling():
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
def _start_web_server():
|
def _start_web_server():
|
||||||
start_server(args=args)
|
start_server(args=args, settings=settings)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -17,7 +17,7 @@ def fetch(settings: list, args: Namespace) -> None:
|
|||||||
s = Session()
|
s = Session()
|
||||||
retries = Retry(
|
retries = Retry(
|
||||||
total=3,
|
total=3,
|
||||||
backoff_factor=0.1,
|
backoff_factor=0.2,
|
||||||
status_forcelist=[502, 503, 504],
|
status_forcelist=[502, 503, 504],
|
||||||
allowed_methods={'GET'},
|
allowed_methods={'GET'},
|
||||||
)
|
)
|
||||||
|
@ -5,11 +5,12 @@ import tornado
|
|||||||
from src.logger import logger as l
|
from src.logger import logger as l
|
||||||
|
|
||||||
|
|
||||||
def start_server(args: Namespace) -> None:
|
def start_server(settings: list, args: Namespace) -> None:
|
||||||
logger = l.getChild(__name__)
|
logger = l.getChild(__name__)
|
||||||
|
|
||||||
def _get_all_feeds():
|
def _get_all_feeds():
|
||||||
return [{ 'rss': f, 'file': f"/feeds/{f}" } for f in fnmatch.filter(os.listdir(args.directory), '*.xml')]
|
return [{ 'rss': sets['name'], 'file': f"/feeds/{sets['rss']}" } for sets in settings if os.path.isfile(f"{args.directory}/{sets['rss']}")]
|
||||||
|
# return [{ 'rss': f, 'file': f"/feeds/{f}" } for f in fnmatch.filter(os.listdir(args.directory), '*.xml')]
|
||||||
|
|
||||||
class MainHandler(tornado.web.RequestHandler):
|
class MainHandler(tornado.web.RequestHandler):
|
||||||
def set_default_headers(self):
|
def set_default_headers(self):
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="body">
|
<div id="body">
|
||||||
<p>Feeds:</p>
|
<h1>Feeds available:</h1>
|
||||||
<ol>
|
<ol>
|
||||||
{% for feed in feeds %}
|
{% for feed in feeds %}
|
||||||
{% module Template("feed.html", feed=feed) %}
|
{% module Template("feed.html", feed=feed) %}
|
||||||
|
Loading…
Reference in New Issue
Block a user