-
Notifications
You must be signed in to change notification settings - Fork 24
Anastasiya_Merkushova_st.merkush@gmail.com - PLS REVIEW #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
clonder
wants to merge
10
commits into
epam-python-courses-7-bsu:master
Choose a base branch
from
clonder:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fd57e18
Made 5 iterations without tests. All comments taken into account.
clonder ba26882
Made 5 iterations without tests. All comments taken into account.
clonder e1bb3b8
fix gitignore
clonder 3e5d173
All comments were corrected and taken into account. Tests are added a…
clonder 95179dd
Update dates.txt
clonder 3cc1a3e
Update dates.txt
clonder a9c6fd5
Update dates.txt
clonder d43b269
Fix critical bug with -pdf
clonder 3608fed
Fix critical bug with -pdf
clonder 85341d6
Update dates.txt
clonder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| .pkl | ||
| __pycache__/ | ||
| .vscode/ | ||
| .idea/ | ||
| .idea | ||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
|
|
||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
|
|
||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| .hypothesis/ | ||
| .pytest_cache/ | ||
|
|
||
| # Translations | ||
| *.mo | ||
| *.pot | ||
|
|
||
| # Django stuff: | ||
| *. | ||
| .log | ||
| local_settings.py | ||
| db.sqlite3 | ||
|
|
||
|
|
||
| # Environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,51 @@ | ||
| # FinalTaskRssReader | ||
| For final task pull requests. | ||
| # **Rss-reader** | ||
| Command-line utility to receive RSS feeds, save it and convert to common formats. | ||
|
|
||
|
|
||
| ## **Example** | ||
|
|
||
| Input: | ||
| ``` | ||
| python3 rss_reader.py "https://news.yahoo.com/rss" -lim 1 | ||
| ``` | ||
| Output: | ||
| ``` | ||
| Title : Rep. Justin Amash turned on Trump. Will his Michigan district follow him — or turn on him? | ||
|
|
||
| Date : 17/11/2019 | ||
|
|
||
| Link : https://news.yahoo.com/rep-justin-amash-turned-on-trump-will-his-michigan-district-follow-him-or-turn-on-him-110017880.html | ||
|
|
||
| Description : If you want to understand how impeachment is being seen by actual Americans, | ||
| there may be no better place to go than Grand Rapids, Mich. In part that’s because | ||
| the area around Grand Rapids, comprising Michigan’s Third Congressional District, | ||
| is one of only about two dozen districts in the nation to vote for Barack Obama and for Donald Trump. | ||
| ``` | ||
| Help: | ||
| ``` | ||
| positional arguments: | ||
| source RSS URL | ||
|
|
||
| optional arguments: | ||
| -h, --help show this help message and exit | ||
| --version Print version info | ||
| --json Print result as JSON in stdout | ||
| --verbose Outputs verbose status messages | ||
| --limit LIMIT Limit news topics if this parameter provided | ||
| --data Print news from the specified day | ||
| --html Convert news in HTML format | ||
| --pdf Condert news in PDF format | ||
| ``` | ||
|
|
||
| ## Installation | ||
| ``` | ||
| git clone https://github.com/Clonder/FinalTaskRssParser.git | ||
| cd/final_task/rss_reader | ||
| pip install -r requirements.txt | ||
| pip install rss-reader | ||
| ``` | ||
|
|
||
|
|
||
| ## How to create a pull request | ||
|
|
||
| 1. Create github account. *Preferrably using email you used when registerer on this course* | ||
| 2. Fork this repository. ('Fork' button at the top right of this repository page) | ||
| 3. Open the page of your *new repository* that was created when you forked this repo. | ||
| 4. Press button clone or download at the middle right of the page and CTRL-C the url. | ||
| 5. On your machine go to the directory you want. | ||
| 6. Depending on the OS you are working with, open GitBash(Windows)/Command Line or Terminal(Linux) there | ||
| 7. Use command `git clone <url_you_copied>` | ||
|
|
||
| Congrats! You have successfully forked our repository. | ||
|
|
||
|
|
||
| ## Additional project structure requirements | ||
|
|
||
| 1. `setup.py` file for setuptools *must* be in the root of `final_task` folder. Use `setup.py` that is already there. (that means path to this file must end with `final_task/setup.py` ) | ||
| 2. Entry point to your application, aka its main module *must* be named as `rss_reader.py` . Use `rss_reader.py` that is already in `rss_reader` folder. | ||
| 3. You should describe how does your project work, how to launch it and etc in README.md in the `final_task/README.md` file. | ||
| 4. If you used any non-standart libraries they must be listed in `rss_reader/requirements.txt` file. | ||
| 5. All unit test files should be in separate folder called `tests`. | ||
|
|
||
|
|
||
| ## Pull request requirements(!!!) | ||
|
|
||
| 1. When creating pull request make sure that `target branch` is `master` on OUR repo, not yours. | ||
| 2. Pull request name *MUST* be in format: `YourFirstName_YourLastName_EmailYouUsedWhileRegisteringOnThisCourse` | ||
| 3. Pull request which have any other name format, or invalid e-mail *will be ignored completely until you fix it*. So make sure you specified correct e-mail. | ||
| 4. In pull request description specify your current iteration. You also can add there any other info you want us to know before we start code review. | ||
| 5. *Pull request must NOT contain any .pyc files, any virtual environment files/folders, any IDE technical files*. | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,49 @@ | ||
| # Your readme here | ||
| Some text. | ||
| Checkout how to write this file using *markdown*. | ||
| # **Rss-reader** | ||
| Command-line utility to receive RSS feeds, save it and convert to common formats. | ||
|
|
||
|
|
||
| ## **Example** | ||
|
|
||
| Input: | ||
| ``` | ||
| python3 rss_reader.py --lim 1 "https://news.yahoo.com/rss" | ||
| ``` | ||
| Output: | ||
| ``` | ||
| Title : Rep. Justin Amash turned on Trump. Will his Michigan district follow him — or turn on him? | ||
|
|
||
| Date : Sun, 17 Nov 2019 06:00:35 -0500 | ||
|
|
||
| Link : https://news.yahoo.com/rep-justin-amash-turned-on-trump-will-his-michigan-district-follow-him-or-turn-on-him-110017880.html | ||
|
|
||
| Description : If you want to understand how impeachment is being seen by actual Americans, | ||
| there may be no better place to go than Grand Rapids, Mich. In part that’s because | ||
| the area around Grand Rapids, comprising Michigan’s Third Congressional District, | ||
| is one of only about two dozen districts in the nation to vote for Barack Obama and for Donald Trump. | ||
| ``` | ||
| Help: | ||
| ``` | ||
| positional arguments: | ||
| source RSS URL | ||
|
|
||
| optional arguments: | ||
| -h, --help show this help message and exit | ||
| --version Print version info | ||
| --json Print result as JSON in stdout | ||
| --verbose Outputs verbose status messages | ||
| --limit LIMIT Limit news topics if this parameter provided | ||
| --data Print news from the specified day | ||
| --html Convert news in HTML format | ||
| --pdf Condert news in PDF format | ||
| ``` | ||
|
|
||
| ## Installation | ||
| ``` | ||
| pip install -r requirements.txt | ||
| pip install rss-reader | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
Binary file not shown.
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import argparse | ||
|
|
||
| version = '5.0' | ||
|
|
||
| """ Add argument commands for script """ | ||
|
|
||
|
|
||
| def command_line(): | ||
| parser = argparse.ArgumentParser( | ||
| description='Pure Python command-line RSS reader.', | ||
| prog='rss-reader') | ||
|
|
||
| parser.add_argument( | ||
| 'URL', | ||
| action="store", | ||
| help='rss url') | ||
|
|
||
| parser.add_argument( | ||
| '-version', | ||
| action='version', | ||
| help='info about version', | ||
| version='rss-reader {}'.format(version)) | ||
|
|
||
| parser.add_argument( | ||
| '-json', | ||
| help='print result as json in stdout', | ||
| action='store_true') | ||
|
|
||
| parser.add_argument( | ||
| '-verbose', | ||
| help="print lots of debugging statements", | ||
| action="store_true") | ||
|
|
||
| parser.add_argument( | ||
| '-lim', | ||
| dest='limit', | ||
| type=int, | ||
| help='Limit news topics if this parameter provided') | ||
|
|
||
| parser.add_argument( | ||
| '-date', | ||
| type=str, | ||
| help='print news from the specified day') | ||
|
|
||
| parser.add_argument( | ||
| '-html', | ||
| action='store_true', | ||
| help='convert news in html format') | ||
|
|
||
| parser.add_argument( | ||
| '-pdf', | ||
| action='store_true', | ||
| help='convert news in pdf format') | ||
|
|
||
| return parser.parse_args() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import urllib.error | ||
| import urllib.request | ||
|
|
||
|
|
||
| def internet_on(): | ||
| try: | ||
| urllib.request.urlopen("http://google.com", timeout=5) | ||
| return True | ||
| except (urllib.error.URLError, urllib.error.HTTPError): | ||
| return False |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 make this into one line, it will be still pretty readable.
Also it is better to use
f""instead of.format().