mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Added Flatpak-specific Python module search paths in plugin init: when FLATPAK_ID is present, the loader now also probes /app/lib/zoitechat/python and /app/lib/x86_64-linux-gnu/zoitechat/python before importing zoitechat.
Kept the existing safe behavior intact: paths are only added if they exist and are not already in sys.path, so this broadens compatibility without duplicating entries.
This commit is contained in:
@@ -550,6 +550,12 @@ def _on_plugin_init(plugin_name, plugin_desc, plugin_version, arg, libdir):
|
|||||||
os.path.join(appdir, 'usr', 'lib', 'x86_64-linux-gnu', 'zoitechat', 'python'),
|
os.path.join(appdir, 'usr', 'lib', 'x86_64-linux-gnu', 'zoitechat', 'python'),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if os.getenv('FLATPAK_ID'):
|
||||||
|
modpaths.extend([
|
||||||
|
'/app/lib/zoitechat/python',
|
||||||
|
'/app/lib/x86_64-linux-gnu/zoitechat/python',
|
||||||
|
])
|
||||||
|
|
||||||
for modpath in modpaths:
|
for modpath in modpaths:
|
||||||
if os.path.isdir(modpath) and modpath not in sys.path:
|
if os.path.isdir(modpath) and modpath not in sys.path:
|
||||||
sys.path.append(modpath)
|
sys.path.append(modpath)
|
||||||
|
|||||||
Reference in New Issue
Block a user