Anatoli_Ageichik_3anatoliageichik@gmail.com#26
Conversation
|
Please, add .idea folder to .gitignore |
And also remove all files from |
| @log_decore | ||
| def get_news(self, index): | ||
| try: | ||
| return self.article.entries[index].summary |
There was a problem hiding this comment.
If the article has no summary this method will return None is this intended?
|
Please remove files from |
|
|
Please write the documentation to your app |
|
|
|
||
| # convert from News class to json | ||
| @log_decore | ||
| def parse_to_json(news): |
There was a problem hiding this comment.
You can use asdict function from dataclasses lib
| link: str | ||
| title: str | ||
| date: str | ||
| links: [] |
There was a problem hiding this comment.
This is not correct typehint
| return all_news | ||
|
|
||
|
|
||
| def create_html_news(path, News=[]): |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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=[]): |
| 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) |
There was a problem hiding this comment.
This is not actual information, it would be nice if you kept it up to date.
|
|
||
| ``python rss_reader.py "https://news.yahoo.com/rss/" --to_pdf "D:\EpamFINAL\FinalTaskRssParser\final_task\rss_reader" | ||
|
|
||
|
|
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
It is better to have more informative filename than this.
|
|
||
| @log_decore | ||
| def correct_title(title): | ||
| return title.replace('"', "_").replace("?", "_").replace(":", "_").replace("'", "_").replace(" ", "_")[:15] |
There was a problem hiding this comment.
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
| from ConvertToHtmlAndPdf import create_html_news | ||
| from ConvertToHtmlAndPdf import create_pdf_news | ||
| from ConvertToHtmlAndPdf import convert_Dict_to_News |
There was a problem hiding this comment.
If you are importing more than two objects from a module it is better to import the whole module itself.
| # 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") |
There was a problem hiding this comment.
It is better to avoid commented out code in the pushed commits.
| url='https://github.com/AnatoliAgeichik/FinalTaskRssParser', | ||
| author='AnatoliAgeichik', | ||
| author_email='3anatoliageichik@gmail.com', | ||
| python_requires='>=3.7.0', |


No description provided.