Formatting
This commit is contained in:
parent
c941453818
commit
6bc38c400e
1 changed files with 10 additions and 10 deletions
20
news.py
20
news.py
|
@ -9,18 +9,18 @@ while any(len(drops[i]) > 77 for i in drops.keys()):
|
||||||
ind = -1
|
ind = -1
|
||||||
g = False
|
g = False
|
||||||
for j in drops.keys():
|
for j in drops.keys():
|
||||||
ind += 1
|
ind += 1
|
||||||
if len(drops[j]) > 77:
|
if len(drops[j]) > 77:
|
||||||
if len(drops[j].split()) > 1:
|
if len(drops[j].split()) > 1:
|
||||||
g = True
|
g = True
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
drops[j] = drops[j][:74] + "..."
|
drops[j] = drops[j][:74] + "..."
|
||||||
if not g:
|
if not g:
|
||||||
break
|
break
|
||||||
if drops.get(ind+1,None) == None:
|
if drops.get(ind + 1, None) == None:
|
||||||
drops[ind+1] = ""
|
drops[ind + 1] = ""
|
||||||
drops[ind+1] = f"{drops[ind].split()[-1]} {drops[ind+1]}".strip()
|
drops[ind + 1] = f"{drops[ind].split()[-1]} {drops[ind+1]}".strip()
|
||||||
drops[ind] = " ".join(drops[ind].split()[:-1])
|
drops[ind] = " ".join(drops[ind].split()[:-1])
|
||||||
title = "\n * ".join(drops.values()).lstrip("\n")
|
title = "\n * ".join(drops.values()).lstrip("\n")
|
||||||
link = doc[5][1].attrib["href"]
|
link = doc[5][1].attrib["href"]
|
||||||
|
|
Loading…
Reference in a new issue