zs

Zeitungsschau rss to email converter
git clone git://r-36.net/zs
Log | Files | Refs | LICENSE

commit 3c1cf1ccaff4949d308690d30f581cba80e65593
parent 0180d628cdc90339543dd92098c327f070382cfd
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sun, 16 Mar 2014 12:12:53 +0100

Add a Makefile, config.mk and fix two exceptions.

Diffstat:
Makefile | 45+++++++++++++++++++++++++++++++++++++++++++++
config.mk | 13+++++++++++++
zs.py | 5+++++
3 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,45 @@ +# zeitungsschau - rss2email +# See LICENSE file for copyright and license details. + +include config.mk + +SRC = ${NAME}.py +OBJ = ${SRC:.py=.exe} + +all: options ${NAME} + +options: + @echo ${NAME} build options: + @echo "CC = ${CC}" + +${OBJ}: config.mk + +${NAME}: ${OBJ} + @echo CC -o $@.py + @${CC} $@.py + +clean: + @echo cleaning + @rm -f ${NAME}.exe __pycache__ zs.build ${NAME}-${VERSION}.tar.gz + @find bin -type l -exec rm {} \; + +dist: clean + @echo creating dist tarball + @mkdir -p ${NAME}-${VERSION} + @cp -R LICENSE README.md config.mk Makefile \ + *.py ${NAME}-${VERSION} + @tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION} + @gzip ${NAME}-${VERSION}.tar + @rm -rf ${NAME}-${VERSION} + +install: all + @echo installing executable files to ${DESTDIR}${PREFIX}/bin + @mkdir -p ${DESTDIR}${PREFIX}/bin + @cp zs.exe ${DESTDIR}${PREFIX}/bin/zs + +uninstall: + @echo removing executable files from ${DESTDIR}${PREFIX}/bin + @rm -f ${DESTDIR}${PREFIX}/bin/zs + +.PHONY: all options clean dist install uninstall + diff --git a/config.mk b/config.mk @@ -0,0 +1,13 @@ +# Zeitungsschau metadata +NAME = zs +VERSION = 0.1 + +# Customize below to fit your system + +# paths +PREFIX = /usr/local +MANPREFIX = ${PREFIX}/share/man + +# compiler and linker +CC = nuitka --recurse-all + diff --git a/zs.py b/zs.py @@ -12,6 +12,7 @@ import feeddb import opml import feedemail import urllib.error +import socket def run(db, selfeed=None, dryrun=False): feeduris = db.listfeeds() @@ -32,6 +33,10 @@ def run(db, selfeed=None, dryrun=False): print("404 -> pause %s" % (feeduri)) db.pause(feeduri) continue + except socket.gaierror: + continue + except TimeoutError: + continue clen = len(curfeed["articles"]) if clen == 0: