Fix is_frozen
, get_core_path()
, get_gui_path()
when cx_freeze
is used for building binaries
#8001
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #8000.
First, it fixes the logic of
is_frozen()
and several functions that return base paths for resources (such asget_logger_config_path()
).Second, it fixes an issue with function naming: Currently, in Tribler we have two different functions with the same name
get_base_path()
that return different results:tribler/core/utilities/install_dir.py
and returns "some" base directory; that exact meaning of the directory is different when Tribler runs from sources and when it runs as a binary. It is only used by another function,get_lib_path()
, which is defined in the same module.get_base_path()
is defined intribler/gui/utilities.py
and returns base directory for GUI-related resources.To avoid confusion and re-use the common logic, this PR renames and reactors the mentioned functions in the following way:
get_base_path()
fromtribler.core.utilities.install_dir
keeps its name, but now it always returns the directory that containscore
/gui
subdirectories.get_lib_path()
is renamed toget_core_path()
and returns thecore
directory as before.get_base_path()
fromtribler/gui/utilities
is renamed toget_gui_path()
and returns thegui
directory as before.Now all three functions
get_core_path()
,get_gui_path()
,get_logger_config_path()
internally useget_base_path()
to avoid code duplication.