Skip to content

Commit 028bc38

Browse files
committed
feat: add LogosCrash.log to support package
Tests: LogosCrash.log - Logos install dir with a file named LogosCrash.log in the proper folder - Ran Get Support - Opened zip - Confirmed LogosCrash.log exists VerbumCrash.log - Verbum install dir with a file named VerbumCrash.log in the proper folder - Ran Get Support - Opened zip - Confirmed VerbumCrash.log exists Missing LogosCrash.log - Logos install dir without a file named LogosCrash.log in the proper folder - Ran Get Support - Opened zip - Confirmed other files other than LogosCrash.log exists Fixes: #386
1 parent db5e386 commit 028bc38

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

ou_dedetai/config.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,20 @@ def get_wine_user(wine_prefix: str) -> Optional[str]:
482482
return None
483483

484484

485+
def get_appdata_dir(
486+
wine_prefix: str,
487+
wine_user: str,
488+
) -> str:
489+
return f'{wine_prefix}/drive_c/users/{wine_user}/AppData/'
490+
491+
485492
def get_logos_appdata_dir(
486493
wine_prefix: str,
487494
wine_user: str,
488495
faithlife_product: str
489496
) -> str:
490-
return f'{wine_prefix}/drive_c/users/{wine_user}/AppData/Local/{faithlife_product}'
497+
appdata = get_appdata_dir(wine_prefix=wine_prefix, wine_user=wine_user)
498+
return f'{appdata}/Local/{faithlife_product}'
491499

492500

493501
def get_logos_user_id(
@@ -820,6 +828,33 @@ def _logos_appdata_dir(self) -> Optional[str]:
820828
self.faithlife_product
821829
)
822830

831+
@property
832+
def _faithlife_logs_dir(self) -> Optional[str]:
833+
"""Path to the directory containing faithlife logs"""
834+
# We don't want to prompt the user in this function
835+
wine_user = self.wine_user
836+
if (
837+
wine_user is None
838+
or self._raw.faithlife_product is None
839+
or self._raw.install_dir is None
840+
):
841+
return None
842+
appdata = get_appdata_dir(
843+
self.wine_prefix,
844+
wine_user,
845+
)
846+
return f'{appdata}/Local/Faithlife/Logs/{self.faithlife_product}'
847+
848+
@property
849+
def _faithlife_crash_log(self) -> Optional[str]:
850+
"""Path to the LogosCrash.log or VerbumCrash.log respectively"""
851+
faithlife_logs = self._faithlife_logs_dir
852+
if not faithlife_logs or self._raw.faithlife_product is None:
853+
return None
854+
# FIXME: Confirm Verbum's Crash log has this name - not aware of a Verbum crash right now
855+
# to confirm this.
856+
return f"{faithlife_logs}/{self._raw.faithlife_product}Crash.log"
857+
823858
@property
824859
def _logos_user_id(self) -> Optional[str]:
825860
"""Name of the Logos user id throughout the app"""

ou_dedetai/control.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ def get_support(app: App) -> str:
126126
zip.write(app.conf.app_wine_log_path)
127127
if Path(app.conf.app_wine_log_previous_path).exists():
128128
zip.write(app.conf.app_wine_log_previous_path)
129+
# Only include LogosCrash.log for now. Logos.log can include
130+
# information about which books the user owns which is more information than
131+
# The user would probably expect to be included in a support package.
132+
if (
133+
app.conf._faithlife_crash_log is not None and
134+
Path(app.conf._faithlife_crash_log).exists()
135+
):
136+
zip.write(app.conf._faithlife_crash_log)
137+
129138
if Path("/etc/os-release").exists():
130139
zip.write("/etc/os-release")
131140
run_commands = [

0 commit comments

Comments
 (0)