Skip to content

Victoria_Kondrat'eva_sam.kondrateva@gmail.com#14

Open
Victoria-Sam wants to merge 10 commits into
epam-python-courses-7-bsu:masterfrom
Victoria-Sam:master
Open

Victoria_Kondrat'eva_sam.kondrateva@gmail.com#14
Victoria-Sam wants to merge 10 commits into
epam-python-courses-7-bsu:masterfrom
Victoria-Sam:master

Conversation

@Victoria-Sam

@Victoria-Sam Victoria-Sam commented Nov 8, 2019

Copy link
Copy Markdown

Five iterations.

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 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 application work:

  1. If user does not specify limit he/she should get all available feed.

  2. Your app has encoding problems. (check the image below)

  3. Sometimes there is no link in the Source of image

image

  1. For future iterations it wold be better to print where exactly the image is inside the news text (check the example in FinalTask.md)

5 (optional). It would be nice if you add some more logging.

@HenadziStantchik HenadziStantchik changed the title Victoria_Kondrat'eva_sam.kondrateva@gmail.com - PLEASE REVIEW Victoria_Kondrat'eva_sam.kondrateva@gmail.com Nov 8, 2019
Comment thread final_task/rss_reader/rss_reader.py Outdated
bs = BeautifulSoup(news['summary'], 'html.parser')
img = bs.find_all('img')
image_data = 'No image'
if len(img) > 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.

Such check should look: if not img:

Comment thread final_task/rss_reader/rss_reader.py Outdated
dictionary_of_news_data = self.make_news_data(news)
except Exception as ex:
self.log("Error processing news: {} {}".format(type(ex), ex))
continue # continues to process the following news

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.

You dont need continue in here. After handling of an excetion, cycle will continue anyway

Comment thread final_task/rss_reader/rss_reader.py Outdated
@Victoria-Sam Victoria-Sam changed the title Victoria_Kondrat'eva_sam.kondrateva@gmail.com Victoria_Kondrat'eva_sam.kondrateva@gmail.com - PLEASE REVIEW Nov 18, 2019
Comment thread final_task/README.md Outdated
Comment thread final_task/rss_reader/NewsCache.py
self.logger.warning("Warning! Caching file is not found!")
self.cache_news = {}

def caching(self, all_news, url):

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: please use more informative method names

Comment thread final_task/rss_reader/RSSReader.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
@HenadziStantchik

Copy link
Copy Markdown
Collaborator
  1. User should be able to specify RSS url without --source option

  2. Your app has encoding problem

kondrat

@HenadziStantchik HenadziStantchik changed the title Victoria_Kondrat'eva_sam.kondrateva@gmail.com - PLEASE REVIEW Victoria_Kondrat'eva_sam.kondrateva@gmail.com Nov 19, 2019
@Victoria-Sam Victoria-Sam changed the title Victoria_Kondrat'eva_sam.kondrateva@gmail.com Victoria_Kondrat'eva_sam.kondrateva@gmail.com-PLEASE REVIEW Nov 24, 2019
@HenadziStantchik

HenadziStantchik commented Nov 24, 2019

Copy link
Copy Markdown
Collaborator

Pdf conversion seems bugged:

k

Keep in mind that user should be able to specify the path where converted file should be saved.

@HenadziStantchik HenadziStantchik changed the title Victoria_Kondrat'eva_sam.kondrateva@gmail.com-PLEASE REVIEW Victoria_Kondrat'eva_sam.kondrateva@gmail.com Nov 24, 2019
Comment thread final_task/setup.py
import sys
sys.path.append('rss_reader')
from setuptools import setup, find_packages
from 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 will not work on clean machine, if there are no libs from requirements.txt installed.

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.

I tried running on a clean machine. When libraries is installed, just start it as rss_reader.rss_reader.
Example:
python -m rss_reader.rss_reader "http://news.yahoo.com/rss/" --limit 2 --verbose

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.

When libraries is installed

Yes, when libraries are installed. The idea of second iteration is that your app will download required libs itself, without you doing pip install -r requirements.txt

python -m rss_reader.rss_reader "http://news.yahoo.com/rss/" --limit 2 --verbose

Your app works perfectly while using python rss_reader..., But the idea of second iteration is to install a CLI utility, that will allow you to run your app like this:

rss-reader <rss_source> <options>

Without manually installing required libs.

Comment thread final_task/setup.py

setup(
name='rss_reader',
version=rss_reader.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.

In this specific case it is better either hardcode this value or import in from some file.

Comment thread final_task/setup.py
description='RSS Reader',
entry_points={'console_scripts': ['Rss-Reader = rss_reader.rss_reader:main']},
keywords="rss-reader",
python_requires='>=3.7',

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 should be 3.8

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is feedback on your application:
Iteration 1:
Everything works fine
Iteration 2:
Does not install.
image
Iteration 3:
Everything works fine.
Iteration 4:
EPUB file does not contain images.
Keep in mind that user must specify a directory, not a file in --to_pdf and --to_epub options
Iteration 5:
Everything works fine.

Tests are ok, but the coverage is barely enough.
Project documentation is decent.
The code overall is readable, absolutely corresponds to the PEP8 guidelines and decently structured.
Commit messages could be more informative, but correspond to the recommended commit message style.


def get_output_function(converter):
"""Output factory"""
if converter == '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.

Instead if multiple if statements you could create dictionary and get needed handler by key, e.g
{
'json': json_handler,
....
}

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