Skip to content

Vitali_Kozlou_h4j0rx@gmail.com#13

Open
kaz1ou wants to merge 2 commits into
epam-python-courses-7-bsu:masterfrom
kaz1ou:master
Open

Vitali_Kozlou_h4j0rx@gmail.com#13
kaz1ou wants to merge 2 commits into
epam-python-courses-7-bsu:masterfrom
kaz1ou:master

Conversation

@kaz1ou

@kaz1ou kaz1ou commented Nov 8, 2019

Copy link
Copy Markdown

Iterations 1 and 2 are done. Please review.

Comment thread final_task/rss_reader/rss_reader.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated


parser = argparse.ArgumentParser()
parser.add_argument('--url', type=str, help='Please enter a valid URL for RSS Feed')

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.

RSS url is supposed to be passed to your application without option --url check example in FinalTask.md

:param verbose: True of False
:return: non-formatted feed
"""
if verbose:

@HenadziStantchik HenadziStantchik Nov 8, 2019

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 below. For such logging purposes it is bettert to use logging standart library. Check it out

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
Comment thread final_task/rss_reader/rss_reader.py
@HenadziStantchik

HenadziStantchik commented Nov 8, 2019

Copy link
Copy Markdown
Collaborator

Some feedback on your application work:

  1. If user did not specify limit then he will only get 1 news entry. He/she should get all available feed instead

  2. If the limit is larger than number of feed entries then you get the IndexError with traceback in stdout.

  3. There are no --json argument (check iteration 1)

  4. --verbose option should not get any arguments. For example:
    python rss_reader.py <rss_url> --verbose]
    UPD: the same for --version

  5. Please add logging to more functions.

6 (optional). A minor thing but if there are many news printed it becomes hard to tell where ends one and starts another. Please separate them a bit better.

@HenadziStantchik HenadziStantchik changed the title Vitali_Kozlou_h4j0rx@gmail.com - PLEASE REVIEW Vitali_Kozlou_h4j0rx@gmail.com Nov 8, 2019
@kaz1ou kaz1ou changed the title Vitali_Kozlou_h4j0rx@gmail.com Vitali_Kozlou_h4j0rx@gmail.com - PLEASE REVIEW Nov 9, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Fixed all, according to your comments. Please review

Please do not use such commit messages. They should correspond to commit message style guide.
You can find it in materials section of our GIT session presentation

print('Wait a second, we will check if there is any RSS in URL you have given')
print('-' * 50)
response = get(url)
r = response.headers['Content-Type'] # We will check only headers

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 one-letter variable names

@HenadziStantchik

Copy link
Copy Markdown
Collaborator
  1. If --version argument is specified application should just print its current bersion and shutdown.
    Also user should be able to use --version argument without specifying source url.

  2. Add a bit more logging to make ``-verbose` argument more explicit. For example, you can add some logging to functions that print news.

  3. Right now your application just throws off images from the feed. for the future iterations you may want to have links to them (checkout example in FinalTask.md)

  4. There is much redundant information in resulting json after using --json option.
    There is also html and encoding problems in it.

@HenadziStantchik HenadziStantchik changed the title Vitali_Kozlou_h4j0rx@gmail.com - PLEASE REVIEW Vitali_Kozlou_h4j0rx@gmail.com Nov 9, 2019
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