Skip to content

Vlad_Protosevich_protosevich2001@gmail.com#9

Open
protosevichVlad wants to merge 12 commits into
epam-python-courses-7-bsu:masterfrom
protosevichVlad:master
Open

Vlad_Protosevich_protosevich2001@gmail.com#9
protosevichVlad wants to merge 12 commits into
epam-python-courses-7-bsu:masterfrom
protosevichVlad:master

Conversation

@protosevichVlad

Copy link
Copy Markdown

Iteration 3
Add README and bug fixes

@protosevichVlad protosevichVlad changed the title Protosevich_Vlad_protosevic2001@gmail.com Vlad_Protosevich_protosevich2001@gmail.com Nov 5, 2019
@HenadziStantchik HenadziStantchik added the please review I want mentors to review my PR ASAP label Nov 5, 2019
Comment thread final_task/README.md
Comment thread final_task/rss_reader/rss_reader.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
@HenadziStantchik

HenadziStantchik commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator

Here is feedback about your script work:

  1. You cannot get the app version without specifying source RSS (e.g. python rss_reader.py --version does not work)
  2. You have encoding problem:

image

  1. While you are parsing news correctly, it would be better if you at least numerate links to the images. You got them numerated in news feed, but in links they are not. Or for the future implementations it would be better group them like this:
Title: ...
Date: ...
Link: ...
Description: ...
Links:
[1] - image_1_url
[2] - image_2_url
...

This way you could awoid potential mistakes in the future convertations to other formats.

  1. --verbose option does not work.

  2. If --limit was not specified by user then you should print all available feed.

  3. Your script freezes if --limit equals a certain number.
    (A hint: try different large --limit and see what happens)

  4. --limit does not work on number of news when using --date

  5. If I use reader with --limit 5 and then with --limit 1 your script will save only 1 piece of news to the cache.

upd: please be sure to use labels in the future. Check slack for more info.

@HenadziStantchik HenadziStantchik added reviewed Review was performed and removed please review I want mentors to review my PR ASAP reviewed Review was performed labels Nov 5, 2019
@protosevichVlad protosevichVlad changed the title Vlad_Protosevich_protosevich2001@gmail.com Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Nov 7, 2019
@protosevichVlad

Copy link
Copy Markdown
Author

Iteration 3

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

I am getting ModuleNotFoundError by trying to launch your app without using distribution tools. Please fix it.

Comment thread final_task/rss_reader/rss_reader.py Outdated
Comment thread final_task/rss_reader/__init__.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
Comment thread final_task/rss_reader/work_with_text.py Outdated
Comment thread final_task/rss_reader/work_with_text.py
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is feedback about your script work:

  1. You cannot get the app version without specifying source RSS (e.g. python rss_reader.py --version does not work)
  2. You have encoding problem:

image

  1. While you are parsing news correctly, it would be better if you at least numerate links to the images. You got them numerated in news feed, but in links they are not. Or for the future implementations it would be better group them like this:
Title: ...
Date: ...
Link: ...
Description: ...
Links:
[1] - image_1_url
[2] - image_2_url
...

This way you could awoid potential mistakes in the future convertations to other formats.

  1. --verbose option does not work.
  2. If --limit was not specified by user then you should print all available feed.
  3. Your script freezes if --limit equals a certain number.
    (A hint: try different large --limit and see what happens)
  4. --limit does not work on number of news when using --date
  5. If I use reader with --limit 5 and then with --limit 1 your script will save only 1 piece of news to the cache.

upd: please be sure to use labels in the future. Check slack for more info.

Also please respond in comments what of these points did you fix.

@HenadziStantchik HenadziStantchik changed the title Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Vlad_Protosevich_protosevich2001@gmail.com Nov 8, 2019
@protosevichVlad

Copy link
Copy Markdown
Author

Here is feedback about your script work:

  1. You cannot get the app version without specifying source RSS (e.g. python rss_reader.py --version does not work)
  2. You have encoding problem:

image

  1. While you are parsing news correctly, it would be better if you at least numerate links to the images. You got them numerated in news feed, but in links they are not. Or for the future implementations it would be better group them like this:
Title: ...
Date: ...
Link: ...
Description: ...
Links:
[1] - image_1_url
[2] - image_2_url
...

This way you could awoid potential mistakes in the future convertations to other formats.

  1. --verbose option does not work.
  2. If --limit was not specified by user then you should print all available feed.
  3. Your script freezes if --limit equals a certain number.
    (A hint: try different large --limit and see what happens)
  4. --limit does not work on number of news when using --date
  5. If I use reader with --limit 5 and then with --limit 1 your script will save only 1 piece of news to the cache.

upd: please be sure to use labels in the future. Check slack for more info.

Also please respond in comments what of these points did you fix.

--version - fixed
encoding problem - fixed
--verbose - fixed
--limit - fixed

@protosevichVlad protosevichVlad changed the title Vlad_Protosevich_protosevich2001@gmail.com Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Nov 8, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is some feedback on your application:

1 (optional). It would be great to add some more logging to printong functions.

  1. --date argument stopped working completely. instead I get FileNotFoundError with traceback to stdout.

Please address existing issues

@HenadziStantchik HenadziStantchik changed the title Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Vlad_Protosevich_protosevich2001@gmail.com Nov 8, 2019
Comment thread final_task/rss_reader/MyException.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
Comment thread final_task/rss_reader/work_with_file.py Outdated
Comment thread final_task/rss_reader/work_with_file.py Outdated
Comment thread final_task/rss_reader/work_with_html.py
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

2. HTML-convertation has encoding problems:

protosevich

Sometimes there are empty lines in the image url list:

protosevich

Please ensure that your app works with RSS feed urls other than yahoo.
For any other RSS url I tried I got an ERROR: HTTP STATUS CODE 301

Also please describe the issues you fixed either in the commit message or in the comments here

@HenadziStantchik HenadziStantchik changed the title Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Vlad_Protosevich_protosevich2001@gmail.com Nov 18, 2019
@protosevichVlad

Copy link
Copy Markdown
Author

Sometimes there are empty lines in the image url list:

protosevich

Please ensure that your app works with RSS feed urls other than yahoo.
For any other RSS url I tried I got an ERROR: HTTP STATUS CODE 301

Fixed

@protosevichVlad

Copy link
Copy Markdown
Author
  1. HTML-convertation has encoding problems:

protosevich

If you will see symbols, take screenshots these symbols in cmd(terminal) or site

@protosevichVlad protosevichVlad changed the title Vlad_Protosevich_protosevich2001@gmail.com Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Nov 19, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator
  1. HTML-convertation has encoding problems:

protosevich

If you will see symbols, take screenshots these symbols in cmd(terminal) or site

Problem still persists

@HenadziStantchik HenadziStantchik changed the title Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Vlad_Protosevich_protosevich2001@gmail.com Nov 19, 2019
@protosevichVlad

Copy link
Copy Markdown
Author

The problem is the symbol '. After checking in different browsers and on different OS the problem was not noticed. If you have a problem this time, please specify the browser through which you check it.

@protosevichVlad protosevichVlad changed the title Vlad_Protosevich_protosevich2001@gmail.com Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Nov 19, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

The problem is the symbol '. After checking in different browsers and on different OS the problem was not noticed. If you have a problem this time, please specify the browser through which you check it.

The issue disappeared

@HenadziStantchik HenadziStantchik changed the title Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Vlad_Protosevich_protosevich2001@gmail.com Nov 20, 2019
@protosevichVlad

Copy link
Copy Markdown
Author

Iteration 5. Colorize should work in pdf and html?

@protosevichVlad protosevichVlad changed the title Vlad_Protosevich_protosevich2001@gmail.com Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Nov 23, 2019
Comment thread final_task/rss_reader/rss_reader.py Outdated
raise RssReaderException.RssReaderException('How work with application?\nEnter in command line: rss-reader -h')

if args.version:
result = f'RSS reader version {__init__.VERSION}'

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.

It's not a good practive to use init file like that. You can define it here, in this module or make a file VERSION.txt, for example, that will contain the version of your application

@dzhigailo dzhigailo changed the title Vlad_Protosevich_protosevich2001@gmail.com - PLEASE REVIEW Vlad_Protosevich_protosevich2001@gmail.com Nov 23, 2019
try:
data = feedparser.parse(url)
try:
if data.status == 200:

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.

It is better to avoid using status for checking if we received feed or not.

data here has type FeedParserDict, which is inherited from dict, so it is a dictionary, which has keys and values.
Neither FeedParserDict nor dict have attribute status, so theoretically you should always get an AttributeError here.
BUT FeedParserDict class has its magic method __getattribute__ redefined (note: getattribute is called every time you try to access some object attribute using .) in a way so if there is no such attribute (for example status), it will try to look in this dictionary keys, using __getitem__ (note: getitem is called when you try to acccess some item in collection by key or by index: data["status"]). So there is no attribute status, but status is a key in data dictionary, so it is still luckily works.

In short, using status here is pretty volatile and may break your program, as you can see in one of your tests.
Moreover if you use bozo here you will be able to further simplify this function

Comment on lines +39 to +43
logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%I:%M:%S %p',
stream=sys.stdout, level=logging.DEBUG)
else:
logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%I:%M:%S %p',
filename="sample.log", level=logging.DEBUG)

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.

These two logging line are almost the same, the only difference is in 1 keyword argument. It is better to use separate functions in these situations, but it is not mandatory here.

Comment on lines +66 to +67
if args.version:
result = f'RSS reader version {open("VERSION.txt").readline()}'

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.

It would be better if you put it instead of pass before

Comment thread final_task/MANIFEST.in
Comment on lines +1 to +2
include rss_reader\TimesNewRoman.ttf
include rss_reader\VERSION.txt No newline at end of file

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.

Because Linux and Windows have different filesystem separators, your setup installation will not work on Linux.

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is feedback on your app:
Iteration 1:
Everything works fine.
Iteration 2:
Everything seems working (but Windows-only, check my comment on your MANIFEST file)
Iteration 3:
Everything works fine, good job on implementing search by rss source.
Iteration 4:
Everything works fine
Iteration 5:
After using --colorize once colour of text in command line changes permanently (Linux) it would be nice to have it changed back. Aside from that everything is fine.

One test does not work: test_rssfile_to_dict, check my comment on your work_with_feedparser.py file. But despite one test not working, coverage rate is still very high.

The code is clean, easy to read, well structured and mostly corresponds to the PEP8 style recommendations. Documentation is a bit lacking, it would be nice if you could put smaller examples here and focus more on describing your project, for example how to install it and etc.

Commit messages mostly correspond to the recommended commit guidelines, but lacking in information.

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