From 6ffcb387eb0f307dc8e0f26f46f41c3b41e6a964 Mon Sep 17 00:00:00 2001 From: jnphilipp Date: Wed, 2 Sep 2015 14:02:24 +0200 Subject: [PATCH] Incorporated The-Compilers suggested chanes. --- misc/userscripts/openfeeds | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/misc/userscripts/openfeeds b/misc/userscripts/openfeeds index 479d0ad1e..9e619ec83 100755 --- a/misc/userscripts/openfeeds +++ b/misc/userscripts/openfeeds @@ -31,9 +31,8 @@ import re from bs4 import BeautifulSoup -if os.environ['QUTE_HTML']: - soup = BeautifulSoup(open(os.environ['QUTE_HTML'], 'r')) - with open(os.environ['QUTE_FIFO'], 'w') as f: - for link in soup.find_all('link', rel='alternate', type=re.compile(r'application/((rss|rdf|atom)\+)?xml|text/xml')): - f.write('open -t %s\n' % link.get('href')) - f.close() +with open(os.environ['QUTE_HTML'], 'r') as f: + soup = BeautifulSoup(f) +with open(os.environ['QUTE_FIFO'], 'w') as f: + for link in soup.find_all('link', rel='alternate', type=re.compile(r'application/((rss|rdf|atom)\+)?xml|text/xml')): + f.write('open -t %s\n' % link.get('href'))