Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mesonium
gajim
Commits
4899b78c
Commit
4899b78c
authored
4 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Add custom module load for GUI
parent
9d4c947b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gajim/gajim.py
+8
-2
8 additions, 2 deletions
gajim/gajim.py
gajim/gui/__init__.py
+38
-0
38 additions, 0 deletions
gajim/gui/__init__.py
with
46 additions
and
2 deletions
gajim/gajim.py
+
8
−
2
View file @
4899b78c
...
...
@@ -24,8 +24,10 @@
from
ctypes.util
import
find_library
from
packaging.version
import
Version
as
V
import
gajim.gui
from
gajim.common
import
i18n
_MIN_NBXMPP_VER
=
'
1.99.0
'
_MIN_GTK_VER
=
'
3.22.27
'
_MIN_CAIRO_VER
=
'
1.16.0
'
...
...
@@ -102,13 +104,16 @@ def _disable_csd():
def
_init_gtk
():
from
gajim.gtk
import
exception
gajim
.
gui
.
init
(
'
gtk
'
)
from
gajim.gui
import
exception
exception
.
init
()
i18n
.
initialize_direction_mark
()
from
gajim.application
import
GajimApplication
def
_run_app
():
from
gajim.application
import
GajimApplication
application
=
GajimApplication
()
_install_sginal_handlers
(
application
)
application
.
run
(
sys
.
argv
)
...
...
@@ -152,3 +157,4 @@ def main():
_set_proc_title
()
_disable_csd
()
_init_gui
(
'
GTK
'
)
_run_app
()
This diff is collapsed.
Click to expand it.
gajim/gui/__init__.py
0 → 100644
+
38
−
0
View file @
4899b78c
import
sys
import
importlib
from
pathlib
import
Path
class
GUIFinder
(
importlib
.
abc
.
MetaPathFinder
):
def
__init__
(
self
,
name
,
fallback
=
None
):
self
.
_path
=
Path
(
__file__
).
parent
.
parent
/
name
self
.
_fallback_path
=
None
if
fallback
is
not
None
:
self
.
_fallback_path
=
Path
(
__file__
).
parent
.
parent
/
fallback
self
.
_suffix
=
'
pyc
'
if
sys
.
platform
==
'
win32
'
else
'
py
'
def
find_spec
(
self
,
fullname
,
_path
,
_target
=
None
):
if
not
fullname
.
startswith
(
'
gajim.gui
'
):
return
None
_namespace
,
module_name
=
fullname
.
rsplit
(
'
.
'
,
1
)
module_path
=
self
.
_path
/
f
'
{
module_name
}
.
{
self
.
_suffix
}
'
if
not
module_path
.
exists
():
if
self
.
_fallback_path
is
None
:
return
None
module_path
=
self
.
_fallback_path
/
f
'
{
module_name
}
.
{
self
.
_suffix
}
'
if
not
module_path
.
exists
():
return
None
spec
=
importlib
.
util
.
spec_from_file_location
(
fullname
,
module_path
)
return
spec
def
init
(
name
,
fallback
=
None
):
sys
.
meta_path
.
append
(
GUIFinder
(
name
,
fallback
=
fallback
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment