Skip to content

Commit ee7ce34

Browse files
committed
CR
1 parent db3c792 commit ee7ce34

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

resources/lib/cabertoss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _vfs_join(base: str, name: str) -> str:
2020
return os.path.join(base, name)
2121

2222

23-
def gather_log_files():
23+
def gather_log_files() -> List[Tuple[str, str]]:
2424
"""
2525
Gather a list of the standard Kodi log files (Kodi.log, Kodi.old.log) and the latest crash log, if there is one.
2626
@@ -29,7 +29,7 @@ def gather_log_files():
2929

3030
# Basic log files
3131
log_files = [('log', os.path.join(LOG_PATH, 'kodi.log'))]
32-
if os.path.exists(os.path.join(LOG_PATH, 'kodi.old.log')):
32+
if xbmcvfs.exists(os.path.join(LOG_PATH, 'kodi.old.log')):
3333
log_files.append(('oldlog', os.path.join(LOG_PATH, 'kodi.old.log')))
3434

3535
# Can we find a crashlog?

resources/lib/store.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Store:
1313

1414
# Static class variables, referred to elsewhere by Store.whatever
1515
# https://docs.python.org/3/faq/programming.html#how-do-i-create-static-class-data-and-static-class-methods
16-
destination_path = None
17-
crashlog_max_days = 3
16+
destination_path: str = ''
17+
crashlog_max_days: int = 3
1818

1919
def __init__(self):
2020
"""
@@ -35,5 +35,5 @@ def load_config_from_settings():
3535
Logger.info(f'Logs will be tossed to: {clean_log(Store.destination_path)}')
3636
else:
3737
Logger.warning('No path set to toss logs to.')
38-
Store.crashlog_max_days = ADDON.getSetting('crashlog_max_days') or 3
38+
Store.crashlog_max_days = int(ADDON.getSetting('crashlog_max_days')) or 3
3939
Logger.info(f'Crashlog max days: {Store.crashlog_max_days}')

resources/settings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
<setting id="crashlog_max_days" type="integer" label="32032" help="">
2121
<level>0</level>
2222
<default>3</default>
23+
<constraints>
24+
<minimum>0</minimum>
25+
<maximum>365</maximum>
26+
<step>1</step>
27+
</constraints>
2328
<control type="edit" format="integer">
2429
<heading>32032</heading>
2530
</control>

0 commit comments

Comments
 (0)