2023-06-03 18:12:55 +02:00
|
|
|
import tomli
|
|
|
|
from column import Column
|
|
|
|
from parse_rss_feeds import parse_rss_feeds
|
|
|
|
|
|
|
|
|
|
|
|
with open("columns.toml", "rb") as f:
|
2023-06-03 19:27:41 +02:00
|
|
|
column_dict = tomli.load(f)
|
|
|
|
columns_file = column_dict["column"]
|
2023-06-03 18:12:55 +02:00
|
|
|
columns = []
|
2023-06-03 19:27:41 +02:00
|
|
|
for column_from_file in columns_file:
|
|
|
|
urls = column_from_file["urls"]
|
|
|
|
title = column_from_file["title"]
|
|
|
|
column = Column(title=title, urls=urls)
|
|
|
|
|
|
|
|
if "limit" in column_from_file:
|
|
|
|
column.set_limit(column_from_file["limit"])
|
|
|
|
if "sort_order" in column_from_file:
|
|
|
|
column.set_sort_order(column_from_file["sort_order"])
|
2023-06-03 18:12:55 +02:00
|
|
|
|
2023-06-03 19:27:41 +02:00
|
|
|
column.load_content_from_feeds()
|
|
|
|
print(len(column.entries))
|