Skip to content

Anatoli_Ageichik_3anatoliageichik@gmail.com#26

Open
AnatoliAgeichik wants to merge 24 commits into
epam-python-courses-7-bsu:masterfrom
AnatoliAgeichik:master
Open

Anatoli_Ageichik_3anatoliageichik@gmail.com#26
AnatoliAgeichik wants to merge 24 commits into
epam-python-courses-7-bsu:masterfrom
AnatoliAgeichik:master

Conversation

@AnatoliAgeichik

Copy link
Copy Markdown

No description provided.

@dzhigailo

Copy link
Copy Markdown
Collaborator

Please, add .idea folder to .gitignore

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please, add .idea folder to .gitignore

And also remove all files from .idea folder from this PR

Comment thread final_task/rss_reader/Handler.py Outdated
Comment thread final_task/rss_reader/Handler.py
@log_decore
def get_news(self, index):
try:
return self.article.entries[index].summary

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.

If the article has no summary this method will return None is this intended?

Comment thread final_task/rss_reader/rss_reader.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
@HenadziStantchik HenadziStantchik changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com-PLEASE REVIEV Anatoli_Ageichik_3anatoliageichik@gmail.com Nov 19, 2019
Comment thread final_task/rss_reader/ConsoleArgument.py Outdated
Comment thread final_task/rss_reader/ConsoleOut.py Outdated
@AnatoliAgeichik AnatoliAgeichik changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com Anatoli_Ageichik_3anatoliageichik@gmail.com - PLEASE REVIEW Nov 20, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please remove files from .idea folder from this PR

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

Copy link
Copy Markdown
Collaborator
  1. User should be able to use --version without RSS url.

  2. It is better for your Link field to store link to an actual news, not to the rss source

@HenadziStantchik HenadziStantchik changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com - PLEASE REVIEW Anatoli_Ageichik_3anatoliageichik@gmail.com Nov 21, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please write the documentation to your app

@AnatoliAgeichik AnatoliAgeichik changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com Anatoli_Ageichik_3anatoliageichik@gmail.com PLEASE REVIEW Nov 22, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator
  1. --limit does not work with --date

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

@HenadziStantchik HenadziStantchik changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com PLEASE REVIEW Anatoli_Ageichik_3anatoliageichik@gmail.com Nov 23, 2019
@AnatoliAgeichik AnatoliAgeichik changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com Anatoli_Ageichik_3anatoliageichik@gmail.com PLEASE REVIEW Nov 23, 2019

# convert from News class to json
@log_decore
def parse_to_json(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 can use asdict function from dataclasses lib

Comment thread final_task/rss_reader/Handler.py Outdated
link: str
title: str
date: str
links: []

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 is not correct typehint

return all_news


def create_html_news(path, 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.

During our course, we've explained why is it bad to use mutable types as default arguments in functions. Please, fix it

def create_html_news(path, News=[]):
try:
os.path.isdir(path) is False
except:

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.

We also explained what may cause except: usage. Please, fix it as well.

raise RssException('Error. No such folder\n')


def create_pdf_news(path, 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.

Same as above

@dzhigailo dzhigailo changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com PLEASE REVIEW Anatoli_Ageichik_3anatoliageichik@gmail.com Nov 24, 2019
@AnatoliAgeichik AnatoliAgeichik changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com Anatoli_Ageichik_3anatoliageichik@gmail.com PLEASE REVIEW Nov 24, 2019
@HenadziStantchik

HenadziStantchik commented Nov 24, 2019

Copy link
Copy Markdown
Collaborator

Sometimes there is missing link to an image:
k

It is preferrable for Link field to contain url to article, not to the rss site

Aside from that I did not discover any issues with Iteration 4 work, Be sure to test it thoroughly youeself in case I did miss something.

@HenadziStantchik HenadziStantchik changed the title Anatoli_Ageichik_3anatoliageichik@gmail.com PLEASE REVIEW Anatoli_Ageichik_3anatoliageichik@gmail.com Nov 24, 2019
Comment thread final_task/README.md
Comment on lines +9 to +16
7 file in my project
- consoleArgumemt.py this file which handles console phrases
- ConsoleOut.py - in this file function which handles print to console
- Handler.py - handles request
- Log.py -
- rss-reader.py - main file in project
- RssException.py - contains exception
- WorkWithCache.py - in this file function which works with cache(read and write 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.

This is not actual information, it would be nice if you kept it up to date.

Comment thread final_task/README.md

``python rss_reader.py "https://news.yahoo.com/rss/" --to_pdf "D:\EpamFINAL\FinalTaskRssParser\final_task\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.

It would be nice to have some info on how to install your app using setuptools.

if os.path.isdir(path) is False:
raise RssException("Error. It isn't a folder")

path = os.path.join(path, "News.html")

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 have more informative filename than this.


@log_decore
def correct_title(title):
return title.replace('"', "_").replace("?", "_").replace(":", "_").replace("'", "_").replace(" ", "_")[:15]

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 rethink this line, or at least leave a docstring here with example of what this function does and why it is needed

Comment on lines +11 to +13
from ConvertToHtmlAndPdf import create_html_news
from ConvertToHtmlAndPdf import create_pdf_news
from ConvertToHtmlAndPdf import convert_Dict_to_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.

If you are importing more than two objects from a module it is better to import the whole module itself.

Comment on lines +35 to +38
# def test_link(self):
# link = "https://news.yahoo.com/rss/"
# hand = Handler("https://news.yahoo.com/rss/", 3)
# self.assertEqual(hand.get_link(link), "https://news.yahoo.com")

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 commented out code in the pushed commits.

Comment thread final_task/setup.py
url='https://github.com/AnatoliAgeichik/FinalTaskRssParser',
author='AnatoliAgeichik',
author_email='3anatoliageichik@gmail.com',
python_requires='>=3.7.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.

It should be 3.8

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is feedback on your app:

Iteration 1:
Everything works fine.
Iteration 2:
Installs, but does not work:
image
Iteration 3:
--date 20191203 does not work, but --date 2019123 works, which is not exactly date format specified in the task.
Aside from this everything is fine
Iteration 4:
Everything works fine.

Commit messages do not correspond to the recommended commit message style.
Some of tests do not work: test_read_file_length. While coverage is high, number of tests is small, which is not really a good thing.
Project's requirements.txt file is empty.
Overall code is mostly readable, mostly corresponds to the PEP8 guidelines.

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