Make > 79 characters lines shorter (except for doctests and copyright) - vt - Print definitions from Vocabolario Treccani
(HTM) hg clone https://bitbucket.org/iamleot/vt
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset 83b15cdff7e356673b67c39731de2693ec4028a3
(DIR) parent e9d9cd19e66a7be4516f9fb99c505174736b8f95
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Sun, 13 May 2018 23:17:59
Make > 79 characters lines shorter (except for doctests and copyright)
Diffstat:
vt.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff -r e9d9cd19e66a -r 83b15cdff7e3 vt.py
--- a/vt.py Sun May 13 23:11:36 2018 +0200
+++ b/vt.py Sun May 13 23:17:59 2018 +0200
@@ -31,8 +31,8 @@
"""
print definition from Vocabolario Treccani
-vt is a Python script/module to print the definition of a term using Vocabolario
-Treccani (<http://www.treccani.it/vocabolario/>).
+vt is a Python script/module to print the definition of a term using
+Vocabolario Treccani (<http://www.treccani.it/vocabolario/>).
"""
@@ -58,7 +58,8 @@
req = request.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0')
with request.urlopen(req) as r:
- t = BeautifulSoup(r, 'html.parser', parse_only=SoupStrainer(class_='text spiega'))
+ t = BeautifulSoup(r, 'html.parser',
+ parse_only=SoupStrainer(class_='text spiega'))
return t.p.text.strip() if t.p else None