-
Notifications
You must be signed in to change notification settings - Fork 32
Shymansky Pavel #23
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?
Shymansky Pavel #23
Conversation
Description: There is a problem with the output of information in printArticles() function. Also few issues connected with argparse module, unrealised json format fully. And russian is not supported here at moment.
.idea/PythonHomework.iml
Outdated
@@ -0,0 +1,11 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<module type="PYTHON_MODULE" version="4"> |
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.
Как я уже писал в чате:
Мета-файлы вашего текстового редактора в репозитории не должны хранится. Если вы используете PyCharm, то вам стоит добавить .idea/ в .gitignore файл.
In this version was fixed bugs with output and added distribution feature
In this version was added such feautures as unittest, some logs, saving news in 'json' format, and fixed bugs related with output
setup.py
Outdated
description = 'CLI utility to process RSS', | ||
author = 'Pavel Shymansky', | ||
py_module = ['rss.parser','arg.py'], | ||
install_requires = ['feedparser', 'bs4'], #!!!!!!!!!!!!!!!!!!!не забытЬ!!!!!!!!!!!!! |
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.
Веселый коментарий :)
Обычно для подобного рода комментариев для "незабывания" используют " # ToDo: "
многие среды разработки умеют красиво их подчеркивать
rss_parser.py
Outdated
logger.info('Limit is {}'.format(args.limit)) | ||
|
||
|
||
def versionInfo(args): |
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.
название метода должно быть маленькими буквами через нижнее подчеркивание
loggerfile.py
Outdated
import logging | ||
extra = {'app_name':'rss_parser'} | ||
|
||
logger = logging.getLogger(__name__) |
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.
в глобальной области видимости обычно не выполняют никакой логики. Лучше перенести эту логику в отдельную функцию, а потом ее вызвать из какой-нибудь функции (например main, или что-то в этом роде)
arg.py
Outdated
@@ -0,0 +1,10 @@ | |||
import argparse | |||
|
|||
parser = argparse.ArgumentParser(description='Pure python command-line RSS reader') |
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.
Такая же ситуация, нужно перенести эту логику в отдельную функцию
setup.py
Outdated
python_requires='>=3.8', | ||
entry_points =''' | ||
[console_scripts] | ||
rss-parser=rss_parser: main |
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.
- в тех задании описано, что утилита должна называться
rss-reader
- не работает после установки:
# rss-parser --help
Traceback (most recent call last):
File "/usr/local/bin/rss-parser", line 5, in <module>
from rss_parser import main
ModuleNotFoundError: No module named 'rss_parser'
Also was added feature --date which cache news, but now it not fully implemented. Method --version was moved in separate file. Logs was added to the another functions
Also was added feature --date which cache news, but now it not fully implemented. Method --version was moved in separate file. Logs was added to the another functions
Add some more logs, add to_pdf function but not implemented fully, add requirements.txt, README.md
parser.add_argument("--verbose", action='store_true', help='Outputs verbose status messages') | ||
parser.add_argument("--limit", help='Limit news topics', type=int) | ||
parser.add_argument("--date", help='Shows cached news on introduced day', type=int) | ||
parser.add_argument("--to_pdf",action='store_true', help = 'Converts news into PDF format' ) |
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.
Конвертация сделана только в один формат?
К сожалению, не работает из-за проблем с импортом # rss-reader --help
Traceback (most recent call last):
File "/usr/local/bin/rss-reader", line 5, in <module>
from rss_reader import main
ModuleNotFoundError: No module named 'rss_reader' |
@AlexeiBuzuma а можешь пожалуйста подсказать как вы проверяли работы? Потому что я чекал на чистой винде и голом линуксе и всё работало |
Работы проверялись в докер контейнерах python:latest. Пункты, которые могут быть улучшены:
|
Description: There is a problem with the output of information in printArticles() function. Also few issues connected with argparse module, unrealised json format fully. And russian is not supported here at moment.