Skip to content

Marina_Romanchuk_marina-romanchuk-2015@mail.ru#27

Open
mrskmrn wants to merge 8 commits into
epam-python-courses-7-bsu:masterfrom
mrskmrn:master
Open

Marina_Romanchuk_marina-romanchuk-2015@mail.ru#27
mrskmrn wants to merge 8 commits into
epam-python-courses-7-bsu:masterfrom
mrskmrn:master

Conversation

@mrskmrn

@mrskmrn mrskmrn commented Nov 20, 2019

Copy link
Copy Markdown

No description provided.

Comment thread final_task/README.md Outdated
Comment thread final_task/rss_reader/console_interface.py Outdated
Comment thread final_task/rss_reader/database_functions.py Outdated
Comment thread final_task/rss_reader/database_functions.py Outdated
Comment thread final_task/rss_reader/database_functions.py Outdated
Comment thread final_task/rss_reader/database_functions.py Outdated
Comment thread final_task/rss_reader/rss_parser.py Outdated
Comment thread final_task/rss_reader/rss_parser.py
Comment thread final_task/rss_reader/rss_parser.py Outdated
Comment thread final_task/rss_reader/rss_parser.py Outdated
Comment thread final_task/rss_reader/rss_parser.py Outdated
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is some feedback on your app work:

  1. User hould be able to use --version without RSS url

  2. If user specified --version app should not print any news.

  3. Right now app does not work:

python rss_reader.py "https://news.yahoo.com/rss/

romanchuk

@HenadziStantchik

HenadziStantchik commented Nov 21, 2019

Copy link
Copy Markdown
Collaborator

Try to rethink logic in your small functions a bit. Right now they are too large

@HenadziStantchik HenadziStantchik changed the title Marina_Romanchuk_marina-romanchuk-2015@mail.ru-PLEASE REVIEW Marina_Romanchuk_marina-romanchuk-2015@mail.ru Nov 21, 2019
@mrskmrn mrskmrn changed the title Marina_Romanchuk_marina-romanchuk-2015@mail.ru Marina_Romanchuk_marina-romanchuk-2015@mail.ru - PLEASE REVIEW Nov 23, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator
  1. --json does not work

  2. has encoding problem (while using date)
    k

Same for HTML converted file

  1. Pdf conversion does not work:
    k

@HenadziStantchik HenadziStantchik changed the title Marina_Romanchuk_marina-romanchuk-2015@mail.ru - PLEASE REVIEW Marina_Romanchuk_marina-romanchuk-2015@mail.ru Nov 23, 2019
Comment thread final_task/README.md
For doing that you should enter directory, and if it's correct, news will be converted and you will see a message,
which tells, if converting was successful or not.
In prepared file (it is named news.pdf or news.html) will be all information about news, if there is no connection
to the Internet, instead of image there will be url of it. No newline at end of file

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.

Please add some info about the way you store files

Comment thread final_task/rss_reader/database_functions.py Outdated
Comment thread final_task/rss_reader/rss_parser.py Outdated
Comment thread final_task/rss_reader/rss_parser.py Outdated
Comment thread final_task/rss_reader/rss_parser.py Outdated
Comment thread final_task/rss_reader/rss_parser.py Outdated
Comment thread final_task/setup.py Outdated
Comment thread final_task/MANIFEST.in
@@ -0,0 +1 @@
include rss_reader/ARIALUNI.ttf No newline at end of file

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 Windows OS, because is has different filesystem path separators (\)

Comment on lines +48 to +54
return {"url": source,
"lim": limit,
"json": json,
"date": date,
"path": path,
"html": to_html,
"pdf": to_pdf}

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 better just to use

{
    "url": args.source,
    ...
}

Instead of creating redundant variables.

print("Invalid directory")
logging.error("Directory doesn't exist")
return None
filename = os.path.join(path_to_file, "news." + expansion)

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 type or format instead of expansion

filename = get_path(dict_of_args.get("path"), "html")
if not filename:
return None
file = open(filename, 'w')

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 context manager for opening and closing file.

from console_interface import parse_args
import logging
import sqlite3
from rss_parser import *

@HenadziStantchik HenadziStantchik Dec 3, 2019

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: it is better to always avoid wildcard import

Comment thread final_task/setup.py
description='Pure Python command-line RSS reader.',
author='Marina Romanchuk',
author_email='marina-romanchuk-2015@mail.ru',
data_files=[('rss_reader', ['rss_reader/ARIALUNI.ttf'])],

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.

Do you actually need this here? You have this file specified in your MANIFEST.in

@@ -0,0 +1,28 @@
import sys
sys.path.insert(1, '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.

sys.path.append will work here too, there is no need to insert it to the second position of the list.

@HenadziStantchik

HenadziStantchik commented Dec 3, 2019

Copy link
Copy Markdown
Collaborator

Here is feedback on your application:
Iteration 1:
All news feed is printed as a FeedParserDict, and then articles are printed normally. But when using --json problem dissapears.
Iteration 2:
Does not install:
image
Iteration 3:
User should be able to specify date using YYYYMMDD format, not YYYYMMD:
image
Iteration 4:
Pdf conversion does not work:
image
Html conversion works normally

Some tests fail. Coverage percentage is not high enough.
Please keep in mind in the future that tests should not depend on any external data (for example on system pats like these C:\\Users\\Lenovo\\PycharmProjects\\fina[51 chars].pdf).
Commit messages could be more informative, however they correspond to the recommended commit message style.
The code is mostly readable, decently structured, mostly correspond 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