-
Notifications
You must be signed in to change notification settings - Fork 30
Dashko Boris #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Dashko Boris #18
Conversation
| @@ -0,0 +1,11 @@ | |||
| import setuptools | |||
|
|
|||
| setuptools.setup( | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Утилита не экспортируется, я не могу проверить функциональность приложения без написания собственного кода.
По тех заданию:
This package should export CLI utility named rss-reader
Cache that include all functions that works witch cache file
rss_reader/cache.py
Outdated
| if self.cursor: | ||
| logger = logging.getLogger('rss_reader') | ||
| logger.error("This is singleton class. Use get_cursor") | ||
| exit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше иметь одну точку выхода из программы (обычно примерно там же, где располагается точка входа в программу)
В данном случае более уместным будет использование исключения, чем exit()
| exit() | ||
| Cache.conn = sqlite3.connect(file_path) | ||
| Cache.cursor = Cache.conn.cursor() | ||
| Cache.cursor.execute('''CREATE TABLE IF NOT EXISTS news(id INTEGER PRIMARY KEY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В данном случае в init происходит нетривальная логика.
Я думаю, будет лучше, если вынести эту логику в отдельный метод.
Все таки из-за этого этот класс имеет иногда страный способ использования например вот так:
@staticmethod
def get_cursor():
"""Static access method. """
if Cache.cursor is None:
Cache()
return Cache.cursor|
при попытке конвертации в html # rss-reader https://news.tut.by/rss/world.rss --to-html /data/news.html
Traceback (most recent call last):
File "/usr/local/bin/rss-reader", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/rss_reader/rss_reader.py", line 61, in main
news.create_html(args.to_html)
File "/usr/local/lib/python3.8/site-packages/rss_reader/news.py", line 173, in create_html
with open(filename, 'w', encoding="utf-8") as html_file:
UnboundLocalError: local variable 'filename' referenced before assignment |
Да, косяк был, исправил, перезалить есть смысл, или уже все? |
|
В выводе новостей (в консоль, в пдф и fb2) отсутствуют картинки и ссылки на них |
|
No description provided.