Skip to content

Pavel_Los_lospawel@yandex.ru#28

Open
paxalos wants to merge 8 commits into
epam-python-courses-7-bsu:masterfrom
paxalos:master
Open

Pavel_Los_lospawel@yandex.ru#28
paxalos wants to merge 8 commits into
epam-python-courses-7-bsu:masterfrom
paxalos:master

Conversation

@paxalos

@paxalos paxalos commented Nov 20, 2019

Copy link
Copy Markdown

5 iterations

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please make your PR name correspond to the one specified in our README.md

@paxalos paxalos changed the title Lospawel@yandex.ru Please Review Pavel_Los_Lospawel@yandex.ru Please Review Nov 21, 2019
@paxalos paxalos changed the title Pavel_Los_Lospawel@yandex.ru Please Review Pavel_Los_lospawel@yandex.ru-PLEASE REVIEW Nov 21, 2019
Comment thread final_task/README.md
Comment thread final_task/rss_reader/parse_rss_functions.py Outdated
Comment thread final_task/rss_reader/parse_rss_functions.py Outdated
Comment thread final_task/rss_reader/parse_rss_functions.py Outdated
Comment thread final_task/rss_reader/personal_exceptions.py Outdated
Comment thread final_task/rss_reader/personal_exceptions.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is some feedback on your app work:

  1. User should be able to use --version without specifying RSS url

  2. Your app does not work on Ubuntu OS:

los

@HenadziStantchik HenadziStantchik changed the title Pavel_Los_lospawel@yandex.ru-PLEASE REVIEW Pavel_Los_lospawel@yandex.ru Nov 21, 2019
@paxalos

paxalos commented Nov 21, 2019

Copy link
Copy Markdown
Author

Doesn't work, because you need to install mysql, then database final_task_database and table nes_cache like in readme

@HenadziStantchik

HenadziStantchik commented Nov 21, 2019

Copy link
Copy Markdown
Collaborator

So the user should install MySQL client, create specific database schema and create specific table inside by himself just to be able to run your application?

How does this work with setuptools?

@paxalos

paxalos commented Nov 21, 2019

Copy link
Copy Markdown
Author

Yes

@paxalos

paxalos commented Nov 21, 2019

Copy link
Copy Markdown
Author

I used database, because it will be necessary in 6 iteration. But now I think that don't have time to do it, that is why I can change datebase storage to store data in simple file. The database doesn't depend on setuptools

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

It is just not a good practice then. An average user (who does not know MySQL at all) will not be able to use your application.

It is up to you to decide what you are going to do, you still have 4 full days until the deadline.

If you really using database for Iteration 6 then it is ok, but make sure that steps of schema and table creation will be automated, so the user will just need to write 1-2 lines in the console to get things going on Iteration 6. You also can try some libs that use mysql, but actually do not require MySQL server installed and operational.

If you are not going to do the 6th iteration the it is of course preferable to simplify things for user: either try to automate it using bash scripts or just switching to a different storage method.

Or you can leave it as is. Of course it is not a good practice to make user manually setup the database, but we will surely not deny/fail your hard work just because of this issue.

P.S. I will test your app today a bit later

Comment thread final_task/README.md
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please check my comment on your README.md

@HenadziStantchik HenadziStantchik added the question Further information is requested label Nov 21, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator
  1. User should be able to user --version without specifying rss url

  2. --date does not seem to work. I get "No news by this datefor any date I specify. ( while the tablenews_cache` contains news data)

  3. Currently you do not have any exception handling on actions with the databse. If anything goes wrong user gets hyge traceback to stdout, which shoiuld not happen

@HenadziStantchik HenadziStantchik removed the question Further information is requested label Nov 21, 2019
…move parsing arguments in separate function, --date and --version can be used without source, fix bugs with writing and reading database. Some other little changes
@paxalos paxalos changed the title Pavel_Los_lospawel@yandex.ru Pavel_Los_lospawel@yandex.ru -PLEASE REVIEW Nov 21, 2019
Comment thread final_task/rss_reader/database_functions.py Outdated
Comment thread final_task/rss_reader/database_functions.py
Comment thread final_task/rss_reader/rss_reader.py
@HenadziStantchik

Copy link
Copy Markdown
Collaborator
  1. I get constant warnings about incorrect date format. It is better either suppress them(not that good option) or fix your datetime->date conversion(preferable option)

  2. --date does not work together with --json

  3. HTML conversion does not work: if user specifies folder then IsADirectoryError is thrown with traceback in stdout. If user specifies file he gets Incorrect html filepath (Ubuntu OS)

Argument that user specifies for conversion to another format should be a directory, not a specific file. Moreover right now if you specify a directory instead of filename it will throw an exception with traceback in stdout

  1. FB2 conversion does not work:

los

  1. Keep in mind that conversion, --colorize and --json should work with --date

  2. (optional) please rethink your color schema design for text background:
    los

@HenadziStantchik HenadziStantchik changed the title Pavel_Los_lospawel@yandex.ru -PLEASE REVIEW Pavel_Los_lospawel@yandex.ru Nov 22, 2019
--date, redo --to-fb2 and --to-html: now the argument is directory and
file news.fb2 or news.html are created in this directory. Some other
little changes
@paxalos paxalos changed the title Pavel_Los_lospawel@yandex.ru Pavel_Los_lospawel@yandex.ru -PLEASE REVIEW Nov 22, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

There are some redundant symbols in fb2 and html converted files:
los

Comment thread final_task/rss_reader/save_in_format_functions.py Outdated
@HenadziStantchik HenadziStantchik changed the title Pavel_Los_lospawel@yandex.ru -PLEASE REVIEW Pavel_Los_lospawel@yandex.ru Nov 22, 2019
@paxalos paxalos changed the title Pavel_Los_lospawel@yandex.ru Pavel_Los_lospawel@yandex.ru -PLEASE REVIEW Nov 22, 2019
@HenadziStantchik HenadziStantchik changed the title Pavel_Los_lospawel@yandex.ru -PLEASE REVIEW Pavel_Los_lospawel@yandex.ru Nov 22, 2019
@paxalos paxalos changed the title Pavel_Los_lospawel@yandex.ru Pavel_Los_lospawel@yandex.ru -PLEASE REVIEW Nov 22, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

I did not discover issues with Iteration 5 functionality. Still be sure to test it yourself, in case I missed something.

@HenadziStantchik HenadziStantchik changed the title Pavel_Los_lospawel@yandex.ru -PLEASE REVIEW Pavel_Los_lospawel@yandex.ru Nov 23, 2019
Comment on lines +67 to +80
news_list.append({'Feed':
html.unescape(parsed_rss['feed']['title']),
'Title':
html.unescape(parsed_rss['entries'][index]['title']),
'Date':
str(date_parser.parse(parsed_rss['entries'][index]['published'])).split(" ")[0],
'Link':
parsed_rss['entries'][index]['link'],
'Image description':
html.unescape(get_image_description(parsed_rss['entries'][index]['summary'])),
'New description':
html.unescape(get_new_description(parsed_rss['entries'][index]['summary'])),
'Image links':
[content['url'] for content in parsed_rss['entries'][index]['media_content']]})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For multiline dictionary declarations it is better to use this codestyle:

news_dict = {
    "key`": value1,
    ....
}

from database_functions import get_news_list_by_date, write_news_to_database
from parse_rss_functions import get_news_list
from custom_exceptions import NoInternet, IncorrectURL, IncorrectFilePath, DatabaseConnectionError
from print_functions import print_news_colorize, print_news_JSON_colorize, print_news, print_news_JSON

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and everywhere else:
If you are using all functions inside imported module it is preferable to use just import

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is some feedback on your application:
Iteration 1:
Everything works fine.
Iteration 2:
Everything installs and works, but only if you install libs specified in requirements.txt first, because not all of them are specified in the dependencies in setup.py
Iteration 3:
News caching does not work for news using Cyrillic symbols. (for example news.tut.by/rss)
Iteration 4:
Everything works fine.
Iteration 5:
Everything works fine.

Commit messages are informative enough and correspond to the recommended commit message style.
Tests are almost nonexistent and coverage percentage is not enough.
Code is mostly readable, but there are some large functions containing too much if/else branching, which lower readability. The code absolutely corresponds to the PEP8 guidelines.

Comment thread final_task/README.md
Comment on lines +5 to +20
usage: rss_reader.py [-h] [--source SOURCE] [--version] [--json] [--verbose]
[--limit LIMIT] [--date DATE]

Pure Python command-line RSS reader.

optional arguments:

-h, --help show this help message and exit
--source SOURCE RSS URL
--version Print version info
--json Print result as JSON in stdout
--verbose Outputs verbose status messages
--limit LIMIT Limit news topics if this parameter provided
--date DATE News from the specified day will be printed out. Format: YYYYMMDD
It is mandatory to specify date or/and time.
If both are specified, then news will be searched by date and by source.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what about Iteration 4 options?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants