Skip to content
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

[WIP] Lastin Egor #41

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

[WIP] Lastin Egor #41

wants to merge 7 commits into from

Conversation

NotEgorL
Copy link

Created functions to find and separate feeds, using https://news.yahoo.com/rss/ like in the example.
Got into grips with the argparse module on a different computer(added parts of it as a docstring to the python script).

Created functions to find and separate feeds, using https://news.yahoo.com/rss/ like in the example.
Got into grips with the argparse module on a different computer(added parts of it as a docstring to the python script).
@NotEgorL NotEgorL changed the title Started working with parsers-Feed and args [WIP] Lastin Egor Nov 10, 2019

# A list to hold all headlines,links,.....

allheadlines=[]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в глобальной секции не должно быть никакой логики. нужно перенести в функции/классы.

return links

#def getTimes( rs_url)
def getHeadlines( rss_url ):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

есть много стилистических ошибок
советую посмотреть в сторону утилиты pycodestyle

@AlexeiBuzuma AlexeiBuzuma added the [Deadline] Iteration 1-2 This is a marker for first and second iterations deadline. label Nov 17, 2019
@NotEgorL
Copy link
Author

mostly finished iteration 1 and had a go with iteration 2.
I added the files to the wrong place so this is my second try at adding to pull.

Iteration one has a working rss reader with a working limit and url parameter, Cleaned up the code a bit with logic and pycodestyle

Added the option to add to file. the file is called news.txt and takes the standard feed from feedparser. the type of it is feedparserdict.
Still need to add classes and take ALL of the logic out, most of it has been done, same with pycodestyle
pep'd and docstring'd. variable name changed
added a -j for json dumping into the console. pycodestyled again
Added more arguments. Namely a -date for task 3 and a -con for converting to  pdf and some other niche. The current functions are stubs for testing purposes.
@@ -0,0 +1,8 @@
from setuptools import setup, find_packages
setup(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

после установки утилиты в чистом докер контейнере через pip install . не появляется утилита rss-reader

# rss-reader --help
bash: rss-reader: command not found

"""import section"""

version = 0.1
parser = argparse.ArgumentParser()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

все еще есть много кода, который хранится в глобальной секции
нужно все перетащить как минимум в функции

print("a")


def captureFeed(URL):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

названия методом должны быть маленькими буквами через нижнее подчеркивание
например capture_feed

"""Outputs a json dump of feed.entries to a file that is called "news.txt".works """
open("news.txt", "w").close()
feed = captureFeed(args.URL)
f = open("news.txt", "w+")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

для работы с файлами имеет смысл использовать контекстные менеджеры

@AlexeiBuzuma AlexeiBuzuma added 3-4 iteration | not implemented and removed Hard Deadline [Deadline] Iteration 1-2 This is a marker for first and second iterations deadline. labels Dec 7, 2019
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.

2 participants