Make it a proper python module
This commit is contained in:
parent
83a32712f9
commit
450de98d32
10 changed files with 160 additions and 42 deletions
30
src/app.py
30
src/app.py
|
@ -1,30 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import gi
|
||||
|
||||
gi.require_version('Gtk', '4.0')
|
||||
gi.require_version('Adw', '1')
|
||||
|
||||
from gi.repository import Adw, Gio
|
||||
from ui import RecoderWindow
|
||||
|
||||
Adw.init()
|
||||
|
||||
class RecoderApp(Adw.Application):
|
||||
def __init__(self):
|
||||
super().__init__(application_id="net.jeena.Recoder",
|
||||
flags=Gio.ApplicationFlags.FLAGS_NONE)
|
||||
self.window = None
|
||||
|
||||
def do_activate(self):
|
||||
if not self.window:
|
||||
self.window = RecoderWindow(application=self)
|
||||
self.window.present()
|
||||
|
||||
def main():
|
||||
app = RecoderApp()
|
||||
return app.run(sys.argv)
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
30
src/recoder/app.py
Executable file
30
src/recoder/app.py
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import gi
|
||||
|
||||
gi.require_version('Gtk', '4.0')
|
||||
gi.require_version('Adw', '1')
|
||||
|
||||
from gi.repository import Adw, Gio
|
||||
|
||||
Adw.init()
|
||||
|
||||
def main():
|
||||
from recoder.ui import RecoderWindow # delayed import
|
||||
|
||||
class RecoderApp(Adw.Application):
|
||||
def __init__(self):
|
||||
super().__init__(application_id="net.jeena.Recoder",
|
||||
flags=Gio.ApplicationFlags.FLAGS_NONE)
|
||||
self.window = None
|
||||
|
||||
def do_activate(self):
|
||||
if not self.window:
|
||||
self.window = RecoderWindow(application=self)
|
||||
self.window.present()
|
||||
|
||||
app = RecoderApp()
|
||||
return app.run(sys.argv)
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
|
@ -7,8 +7,8 @@ gi.require_version('Adw', '1')
|
|||
from gi.repository import Gtk, Adw, Gio, Gdk, GLib
|
||||
from functools import partial
|
||||
|
||||
from config import load_config, save_config
|
||||
from transcoder_worker import TranscoderWorker
|
||||
from recoder.config import load_config, save_config
|
||||
from recoder.transcoder_worker import TranscoderWorker
|
||||
|
||||
class RecoderWindow(Adw.ApplicationWindow):
|
||||
def __init__(self, **kwargs):
|
Loading…
Add table
Add a link
Reference in a new issue