versions.py (versions-1.5.1) | : | versions.py (versions-1.5.2) | ||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
import os | import os | |||
import re | import re | |||
import errno | import errno | |||
import time | import time | |||
import doctest | import doctest | |||
import feedparser | import feedparser | |||
import yaml | import yaml | |||
import operator | import operator | |||
__author__ = "Olivier Delhomme <olivier.delhomme@free.fr>" | __author__ = "Olivier Delhomme <olivier.delhomme@free.fr>" | |||
__date__ = "22.05.2018" | __date__ = "06.11.2018" | |||
__version__ = "1.5.1" | __version__ = "1.5.2" | |||
""" | """ | |||
This program checks projects versions through RSS and Atom feeds and | This program checks projects versions through RSS and Atom feeds and | |||
should only print those with new release version. | should only print those with new release version. | |||
It implements checking for projects in github.com and freshcode.club. | It implements checking for projects in github.com and freshcode.club. | |||
Projects must be added to a YAML file (named by default | Projects must be added to a YAML file (named by default | |||
~/.config/versions/versions.yaml). One can use --file=FILENAME option | ~/.config/versions/versions.yaml). One can use --file=FILENAME option | |||
to specify an alternative YAML file. version.yaml is included as an | to specify an alternative YAML file. version.yaml is included as an | |||
example in this project. | example in this project. | |||
skipping to change at line 845 | skipping to change at line 845 | |||
def get_entry_published_date(entry): | def get_entry_published_date(entry): | |||
""" | """ | |||
Returns the published date of an entry. | Returns the published date of an entry. | |||
Selects the right field to do so | Selects the right field to do so | |||
""" | """ | |||
if 'published_parsed' in entry: | if 'published_parsed' in entry: | |||
published_date = entry.published_parsed | published_date = entry.published_parsed | |||
elif 'updated_parsed' in entry: | elif 'updated_parsed' in entry: | |||
published_date = entry.updated_parsed | published_date = entry.updated_parsed | |||
elif 'pubDate' in entry: # rss-0.91.dtd (netscape) | ||||
published_date = entry.pubDate | ||||
return published_date | return published_date | |||
# End of get_entry_published_date() function | # End of get_entry_published_date() function | |||
def make_list_of_newer_feeds(feed, feed_info, debug): | def make_list_of_newer_feeds(feed, feed_info, debug): | |||
""" | """ | |||
Compares feed entries and keep those that are newer than the latest | Compares feed entries and keep those that are newer than the latest | |||
check we've done and inserting the newer ones in reverse order in | check we've done and inserting the newer ones in reverse order in | |||
a list to be returned | a list to be returned | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 4 lines changed or added |