Skip to content

Usevalad_Trafimau_Unioltered@gmail.com#18

Open
Useftro wants to merge 21 commits into
epam-python-courses-7-bsu:masterfrom
Useftro:master
Open

Usevalad_Trafimau_Unioltered@gmail.com#18
Useftro wants to merge 21 commits into
epam-python-courses-7-bsu:masterfrom
Useftro:master

Conversation

@Useftro

@Useftro Useftro commented Nov 11, 2019

Copy link
Copy Markdown

Please review
Iteration 1 completed (I hope so)

@Useftro Useftro changed the title Iteration 1 Usevalad_Trafimau_Unioltered@gmail.com Nov 11, 2019
Comment thread final_task/.gitignore Outdated
@@ -0,0 +1,2 @@
*.рус

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 to specify .gitignore in each folder. You can define it on project root. Please, add .idea to .gitignore

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.

Fixed.

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.

.idea folder is not added still

Comment thread final_task/rss_parser/Classes/Novelty.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/rss_parser/requirements.txt Outdated
Comment thread final_task/rss_parser/rss_parser.py Outdated
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please add all files that are in .idea folder to gitignore and also remove them from this pull request.

@Useftro Useftro changed the title Usevalad_Trafimau_Unioltered@gmail.com Usevalad_Trafimau_Unioltered@gmail.com -PLEASE REVIEW Nov 13, 2019
except ConnectionError:
logging.critical("CONNECTION ERROR, HELP!")
print("You have some connection problems!")
if '--date' in self.list_of_args:

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 have done the same check in try block. Please, refactor this logic

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.

Fixed, thanks.

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Your project structure does not correspond to project structure specified in README.md

Comment thread final_task/rss_parser/News_cache.txt Outdated
Comment thread final_task/rss_parser/News_cache_json.txt Outdated
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Your setup.py file is empty therefore Iteration 2 has not been done.

Comment thread final_task/rss_parser/mySnake.log Outdated
@HenadziStantchik

HenadziStantchik commented Nov 14, 2019

Copy link
Copy Markdown
Collaborator

Here is some feedback on your application work:

  1. Your app has encoding problem:

tra

Same for News_cache.txt and News_cache_json.txt

  1. --version does not work correctly: user should be able to get version without specifying RSS source. Also it should not take any value, e.g. python rss_reader.py --version

  2. --verbose should print logs in the process of application working, not after everything is done.

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

  4. (optional) If RSS url was not specified, it would be great if your app printed news from all sources available in cache on specified date

Comment thread README.md Outdated
Comment thread final_task/rss_parser/Classes/RSSParser.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/README.md Outdated
@HenadziStantchik HenadziStantchik changed the title Usevalad_Trafimau_Unioltered@gmail.com -PLEASE REVIEW Usevalad_Trafimau_Unioltered@gmail.com Nov 14, 2019
Comment thread final_task/rss_parser/Output_functions.py Outdated
Comment thread final_task/rss_parser/Output_functions.py Outdated
…stead of json to store news at local storage. Fixed some remarks.
@Useftro Useftro changed the title Usevalad_Trafimau_Unioltered@gmail.com Usevalad_Trafimau_Unioltered@gmail.com --PLEASE REVIEW Nov 15, 2019
@HenadziStantchik

HenadziStantchik commented Nov 16, 2019

Copy link
Copy Markdown
Collaborator

Please make your project structure correspond to the one specified in README.md

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Your app does not work:

trafimau

Comment thread final_task/rss_parser/Output_functions.py
@Useftro Useftro changed the title Usevalad_Trafimau_Unioltered@gmail.com Usevalad_Trafimau_Unioltered@gmail.com -PLEASE REVIEW Nov 19, 2019
logging.info("Trying to get page from feedparser!")
the_feed = feedparser.parse(self.feed_url)
logging.info("Got it (the page)!")
if the_feed.get('bozo') == 1:

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 simple if the_feed.get('bozo'), because it can be either 1 or 0

Comment on lines +230 to +239
novelty = "\n{0}.\nTitle: {1}\nDate: {2}\nLink: {3}\nDescription:\n {4}\nImages links:{5}\nAlternative text:{6}\n" \
"Main source: {7}" \
.format(item.number_of_novelty,
pprint.pformat(item.title_of_novelty, width=115),
item.time_of_novelty,
pprint.pformat(item.source_link, width=115),
pprint.pformat(item.description.replace("\xa0", " "), width=115),
pprint.pformat(item.images_links),
pprint.pformat(item.alt_text, width=115),
item.main_source)

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 formatted string for this: f"..."

Comment thread final_task/rss_reader/output_functions.py
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please remove cache and log files from this PR

You can avoid such situations by simply adding each file individually before commit

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please add new libraries to your requirements.txt file and make sure they are specified as dependencies in setup.py file.

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

If --colorize is specified together with --json your app will print both colorized version and json version.

Also, I could not test your Iteration 4 work, because either it does not work or I installed wrong Pillow package version. Please specify it in requirements.txt and in setup.py

Comment thread final_task/rss_reader/output_functions.py Outdated
Comment thread final_task/rss_reader/output_functions.py Outdated
Comment thread final_task/rss_reader/output_functions.py Outdated
@HenadziStantchik HenadziStantchik changed the title Usevalad_Trafimau_Unioltered@gmail.com -PLEASE REVIEW Usevalad_Trafimau_Unioltered@gmail.com Nov 20, 2019
Comment thread final_task/rss_reader/pdf_and_html_converting.py Outdated
Comment thread final_task/rss_reader/pdf_and_html_converting.py Outdated
Comment thread README.md
* If '--colorize' is in console args then we colorize our news in random colors. If there is no '--colorize'
we use usual color (grey-white)
## Important!
When using pdf or html converting input your path in look like this: "C:\\Test\\" or "C:\\Test"

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.

What about Linux OS?

Comment thread README.md
2. Add them into PDF or/and html file
3. Add all other information

* If there is also '--date Y%M%D' in console with '--to-pdf' or/and '--to-html' we write down into the

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 about how to install your app, and also more info about the way you store news entries locally.

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is feedback on your application work:
Iteration 1:
--json has encoding problems.
Also 'empty' links to the images appear in the feed from time to time:
image
If --version is specified, then the app should not print the news feed.(It prints if --json is specified)
Iteration 2:
Does not install successfully:
image
Iteration 3:
Everything works fine.
Iteration 4:
Neither pdf or html conversions do not work:
image
I suppose this happens because of empty image link problem in iteration 1.
Iteration 5:
Everything works fine.

Some of the tests do not work: test_converting_to_HTML
Also keep in mind for the future that tests should not leave any redundant files after completion.
Coverage percentage is small.
The requirements.txt file does not contain all necessary libraries.
The code overall is readable, but there are some big methods/functions which are hard to read. The code absolutely corresponds to the PEP8 guidelines. Commit messages are somewhat informative, but do not correspond to the recommended commit message style.

@Useftro

Useftro commented Dec 1, 2019

Copy link
Copy Markdown
Author

Here is feedback on your application work:
Iteration 1:
--json has encoding problems.
Also 'empty' links to the images appear in the feed from time to time:
image
If --version is specified, then the app should not print the news feed.(It prints if --json is specified)
Iteration 2:
Does not install successfully:
image
Iteration 3:
Everything works fine.
Iteration 4:
Neither pdf or html conversions do not work:
image
I suppose this happens because of empty image link problem in iteration 1.
Iteration 5:
Everything works fine.

Some of the tests do not work: test_converting_to_HTML
Also keep in mind for the future that tests should not leave any redundant files after completion.
Coverage percentage is small.
The requirements.txt file does not contain all necessary libraries.
The code overall is readable, but there are some big methods/functions which are hard to read. The code absolutely corresponds to the PEP8 guidelines. Commit messages are somewhat informative, but do not correspond to the recommended commit message style.

Empty link appears if there is not image in a piece of news. I thought it would be understandable if there is no link then it means that there is no image, but I understand my mistake that it's not understandable and I needed to write also "there is no image".

Converting to HTML or PDF doesn't work not because of empty link because on my computer everything works fine with empty link. I have no idea why it doesnt' work.

If --version and --json are specified program shows version of program and shows json view of news.
If --version and source are specified program shows version of program and shows news from source.
If only --version specified program shows only version.
Is not it how it should work? In FinalTask.pdf is written that if --version specified program shows version and completes it's work => it completes it's work: 'turns off' if no more arguments specified or if it has more arguments it shows news and etc.

@HenadziStantchik

HenadziStantchik commented Dec 3, 2019

Copy link
Copy Markdown
Collaborator

If --version and --json are specified program shows version of program and shows json view of news.
No, for example if you use python --version it does not start python interpreter instance. It just prints version and exits.
--version specified program shows version and completes it's work

This is a problem with our task, yes. I got your point. We will be sure to fix it in the future.

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