parent
6718182411
commit
594e908508
1 changed files with 0 additions and 26 deletions
|
@ -5,7 +5,6 @@ Various functions and decorators for PKC
|
||||||
"""
|
"""
|
||||||
from __future__ import absolute_import, division, unicode_literals
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from cProfile import Profile
|
|
||||||
from pstats import Stats
|
from pstats import Stats
|
||||||
from sqlite3 import connect, OperationalError
|
from sqlite3 import connect, OperationalError
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
@ -580,31 +579,6 @@ def reset(ask_user=True):
|
||||||
reboot_kodi()
|
reboot_kodi()
|
||||||
|
|
||||||
|
|
||||||
def profiling(sortby="cumulative"):
|
|
||||||
"""
|
|
||||||
Will print results to Kodi log. Must be enabled in the Python source code
|
|
||||||
"""
|
|
||||||
def decorator(func):
|
|
||||||
"""
|
|
||||||
decorator construct
|
|
||||||
"""
|
|
||||||
def wrapper(*args, **kwargs):
|
|
||||||
"""
|
|
||||||
wrapper construct
|
|
||||||
"""
|
|
||||||
profile = Profile()
|
|
||||||
profile.enable()
|
|
||||||
result = func(*args, **kwargs)
|
|
||||||
profile.disable()
|
|
||||||
string_io = StringIO()
|
|
||||||
stats = Stats(profile, stream=string_io).sort_stats(sortby)
|
|
||||||
stats.print_stats()
|
|
||||||
LOG.info(string_io.getvalue())
|
|
||||||
return result
|
|
||||||
return wrapper
|
|
||||||
return decorator
|
|
||||||
|
|
||||||
|
|
||||||
def compare_version(current, minimum):
|
def compare_version(current, minimum):
|
||||||
"""
|
"""
|
||||||
Returns True if current is >= then minimum. False otherwise. Returns True
|
Returns True if current is >= then minimum. False otherwise. Returns True
|
||||||
|
|
Loading…
Reference in a new issue