Incorporated The-Compilers suggested chanes.

This commit is contained in:
jnphilipp 2015-09-02 14:02:24 +02:00
parent 1cbc555933
commit 6ffcb387eb

View File

@ -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'))