mirror of
https://github.com/markqvist/Sideband.git
synced 2025-08-20 03:58:26 -04:00
Restructured repository
This commit is contained in:
parent
46269dd82b
commit
0de4c12c17
274 changed files with 51617 additions and 45 deletions
54
sbapp/kivymd/tools/patterns/MVC/main.py_tmp
Normal file
54
sbapp/kivymd/tools/patterns/MVC/main.py_tmp
Normal file
|
@ -0,0 +1,54 @@
|
|||
"""
|
||||
The entry point to the application.
|
||||
|
||||
The application uses the MVC template. Adhering to the principles of clean
|
||||
architecture means ensuring that your application is easy to test, maintain,
|
||||
and modernize.
|
||||
|
||||
You can read more about this template at the links below:
|
||||
|
||||
https://github.com/HeaTTheatR/LoginAppMVC
|
||||
https://en.wikipedia.org/wiki/Model–view–controller
|
||||
"""
|
||||
|
||||
from typing import NoReturn
|
||||
|
||||
from kivy.uix.screenmanager import ScreenManager%s
|
||||
|
||||
from kivymd.app import MDApp
|
||||
|
||||
from View.screens import screens%s
|
||||
%s
|
||||
|
||||
class %s(MDApp):%s
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)%s
|
||||
self.load_all_kv_files(self.directory)
|
||||
# This is the screen manager that will contain all the screens of your
|
||||
# application.
|
||||
self.manager_screens = ScreenManager()
|
||||
%s
|
||||
def build(self) -> ScreenManager:
|
||||
self.generate_application_screens()
|
||||
return self.manager_screens
|
||||
|
||||
def generate_application_screens(self) -> NoReturn:
|
||||
"""
|
||||
Creating and adding screens to the screen manager.
|
||||
You should not change this cycle unnecessarily. He is self-sufficient.
|
||||
|
||||
If you need to add any screen, open the `View.screens.py` module and
|
||||
see how new screens are added according to the given application
|
||||
architecture.
|
||||
"""
|
||||
|
||||
for i, name_screen in enumerate(screens.keys()):
|
||||
model = screens[name_screen]["model"](%s)
|
||||
controller = screens[name_screen]["controller"](model)
|
||||
view = controller.get_view()
|
||||
view.manager_screens = self.manager_screens
|
||||
view.name = name_screen
|
||||
self.manager_screens.add_widget(view)
|
||||
%s%s
|
||||
|
||||
%s().run()
|
Loading…
Add table
Add a link
Reference in a new issue