X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=helpers.py;h=1f89ce58c5c3ea8072d0ffeef928c0c3a51cb300;hb=8fa671984c14627182f89020758a0f46761fe11f;hp=7e67b7ac05223527bc1032530d4668039fda8b80;hpb=0b6ee27776cf0705e930fd5e998f0f98ea85bcd4;p=bup.git diff --git a/helpers.py b/helpers.py index 7e67b7a..1f89ce5 100644 --- a/helpers.py +++ b/helpers.py @@ -45,3 +45,11 @@ def hostname(): except OSError: pass return _hostname or 'localhost' + + +def linereader(f): + while 1: + line = f.readline() + if not line: + break + yield line[:-1]