mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] lisibility
This commit is contained in:
parent
14c270cebd
commit
ac6a14055d
1 changed files with 3 additions and 0 deletions
|
@ -632,10 +632,13 @@ def _tail(file, n):
|
|||
# woops. apparently file is smaller than what we want
|
||||
# to step back, go to the beginning instead
|
||||
f.seek(0)
|
||||
|
||||
pos = f.tell()
|
||||
lines = f.read().splitlines()
|
||||
|
||||
if len(lines) >= to_read or pos == 0:
|
||||
return lines[-to_read]
|
||||
|
||||
avg_line_length *= 1.3
|
||||
|
||||
except IOError:
|
||||
|
|
Loading…
Add table
Reference in a new issue