Philipp Hörist pushed to branch master at gajim / gajim


Commits:
e533fb18 by lovetox at 2022-01-02T10:06:44+01:00
Move application to gtk module

- - - - -
0a1b8b02 by lovetox at 2022-01-02T10:07:19+01:00
Scripts: link-gtk - cleanup dir before linking

- - - - -


4 changed files:

- gajim/common/app.py
- gajim/gajim.py
- gajim/application.py → gajim/gtk/application.py
- scripts/ci/link-gtk.py


Changes:

=====================================
gajim/common/app.py
=====================================
@@ -55,7 +55,7 @@
 
 if typing.TYPE_CHECKING:
     from gajim.gui.main import MainWindow
-    from gajim.application import GajimApplication
+    from gajim.gui.application import GajimApplication
     from gajim.common.storage.cache import CacheStorage
     from gajim.common.storage.archive import MessageArchiveStorage
 


=====================================
gajim/gajim.py
=====================================
@@ -114,7 +114,7 @@ def _init_gtk():
 
 
 def _run_app():
-    from gajim.application import GajimApplication
+    from gajim.gui.application import GajimApplication
     application = GajimApplication()
     _install_signal_handlers(application)
     application.run(sys.argv)


=====================================
gajim/application.py → gajim/gtk/application.py
=====================================


=====================================
scripts/ci/link-gtk.py
=====================================
@@ -17,17 +17,30 @@
 gtk_path = cwd / 'gajim' / 'gtk'
 
 
-def link(target):
+def cleanup_dir(target_dir: Path) -> None:
+    for path in target_dir.iterdir():
+        if path.name in IGNORED_FILES:
+            continue
+        path.unlink()
+
+
+def link(target: Path) -> None:
     source = str(target)
     source = source.replace('gajim/gtk', 'gajim/gui')
     source = Path(source)
     source.symlink_to(target)
     print('create symlink from', source, 'to', target)
 
-for path in gtk_path.iterdir():
-    if path.is_dir():
-        if path.name not in IGNORED_DIRS:
+
+def link_files(source_dir: Path) -> None:
+    for path in source_dir.iterdir():
+        if path.is_dir():
+            if path.name not in IGNORED_DIRS:
+                link(path)
+
+        elif path.name not in IGNORED_FILES:
             link(path)
 
-    elif path.name not in IGNORED_FILES:
-        link(path)
+
+cleanup_dir(gui_path)
+link_files(gtk_path)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/b5a950aa28f40d925a906cec2cf724004756b16c...0a1b8b027057c4cf0dec2813e62c7a8f6d8b1281

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/b5a950aa28f40d925a906cec2cf724004756b16c...0a1b8b027057c4cf0dec2813e62c7a8f6d8b1281
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to