More rename, more -python2
This commit is contained in:
@@ -15,22 +15,15 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import os
|
||||
from io import open
|
||||
|
||||
import os
|
||||
|
||||
import jellypy
|
||||
if jellypy.PYTHON2:
|
||||
import helpers
|
||||
import logger
|
||||
else:
|
||||
from jellypy import helpers
|
||||
from jellypy import logger
|
||||
from jellypy import helpers
|
||||
from jellypy import logger
|
||||
|
||||
|
||||
def get_log_tail(window=20, parsed=True, log_type="server"):
|
||||
|
||||
if jellypy.CONFIG.PMS_LOGS_FOLDER:
|
||||
log_file = ""
|
||||
if log_type == "server":
|
||||
@@ -76,6 +69,7 @@ def get_log_tail(window=20, parsed=True, log_type="server"):
|
||||
|
||||
return log_lines
|
||||
|
||||
|
||||
# http://stackoverflow.com/a/13790289/2405162
|
||||
def tail(f, lines=1, _buffer=4098):
|
||||
"""Tail a file and get X lines from the end"""
|
||||
@@ -105,4 +99,4 @@ def tail(f, lines=1, _buffer=4098):
|
||||
# next X bytes
|
||||
block_counter -= 1
|
||||
|
||||
return lines_found[-lines:]
|
||||
return lines_found[-lines:]
|
||||
|
Reference in New Issue
Block a user