Skip to content

Veranika_Rechyts_verarechyts@gmail.com#10

Open
VeranikaRechyts wants to merge 1 commit into
epam-python-courses-7-bsu:masterfrom
VeranikaRechyts:master
Open

Veranika_Rechyts_verarechyts@gmail.com#10
VeranikaRechyts wants to merge 1 commit into
epam-python-courses-7-bsu:masterfrom
VeranikaRechyts:master

Conversation

@VeranikaRechyts

Copy link
Copy Markdown

please review

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please edit this pull request according to PR requirements and put a label on it

@VeranikaRechyts VeranikaRechyts changed the title Iteration 1. Add rss_reader.py, cmd_line.py, requirements.txt Veranika_Rechyts_verarechyts@gmail.com Nov 6, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please check project structure requirements and see the example in FinalTask.md.
Your script is supposed to launch using rss_reader.py, not any other module. This is critical for our future CI checks.

import sys
import argparse
import logging
from final_task.rss_reader import rss_reader

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.

This package import is redundant here. Think about where exactly import statements starts to search for specified module.

from final_task.rss_reader import rss_reader


__version__ = '1.0'

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.

Global variables are usually declared in uppercase e.g. VERSION

dict_from_rss_site = feedparser.parse(source)
if dict_from_rss_site:
return dict_from_rss_site
else: return ConnectionError(f"{source} can't be reached")

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.

Usually it is better to raise exceptions, not to return them

Comment on lines +15 to +19
def check_key_in_dict_from_rss_site(dict_from_rss_site, key):
"""Function for checking existing of key in dict"""
if dict_from_rss_site.get(key, None):
return True
return False

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 use in operator instead of this function. For example:
if key in dict_from_rss_site:

@HenadziStantchik

HenadziStantchik commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

Unfortunately I was not able to launch your script because of ModuleNotFoundError. Have you tested it?

@HenadziStantchik HenadziStantchik added reviewed Review was performed and removed reviewed Review was performed labels Nov 6, 2019
@VeranikaRechyts

VeranikaRechyts commented Nov 11, 2019 via email

Copy link
Copy Markdown
Author

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