from views.window import Window if __name__ == '__main__': root = Window() root.mainloop()
from models.paintingOptions import PaintingOptions from models.image import Image from views.window import Window from views.toolbar import Toolbar from controllers.canvasController import CanvasController from controllers.toolController import ToolController if __name__ == '__main__': painting_options = PaintingOptions() tool_controller = ToolController(None, None, painting_options) canvas_controller = CanvasController(None, painting_options, tool_controller) root = Window(None, None, canvas_controller) root.title('Paint') root.minsize(800, 670) toolbar = Toolbar(painting_options) image = Image(painting_options) image.bind("<B1-Motion>", canvas_controller.on_mouse_drag) image.bind("<1>", canvas_controller.on_mouse_down) image.bind("<Motion>", canvas_controller.on_mouse_move) image.bind("<B1-ButtonRelease>", canvas_controller.on_mouse_up) toolbar.eraser_button.configure(command=tool_controller.on_toggle_eraser) toolbar.color_picker_button.configure( command=tool_controller.on_change_color_click) toolbar.brush_width_button.configure( command=tool_controller.on_change_brush_width_click)
from utils.file_monitor import FileMonitor from utils.dbus_services import (DeepinMovieServie, check_multiple_instances, DeepinMovieInterface, session_bus, DBUS_PATH) if __name__ == "__main__": result = check_multiple_instances() if result: dbus_service = DeepinMovieServie(app) session_bus.registerObject(DBUS_PATH, dbus_service) else: if not config.playerMultipleProgramsAllowed: dbus_interface = DeepinMovieInterface() dbus_interface.play(json.dumps(sys.argv[1:])) os._exit(0) windowView = Window(result or len(sys.argv) > 1) menu_controller = MenuController() file_monitor = FileMonitor() findVideoThreadManager = FindVideoThreadManager() subtitleParser = Parser() settings = DMSettings() app._extra_window = weakref.ref(windowView) qml_context = windowView.rootContext() qml_context.setContextProperty("config", config) qml_context.setContextProperty("_settings", settings) qml_context.setContextProperty("_utils", utils) qml_context.setContextProperty("_findVideoThreadManager", findVideoThreadManager) qml_context.setContextProperty("_file_monitor", file_monitor)
from views.window import Window import gtk # If the program is run directly or passed as an argument to the python # interpreter then create a HelloWorld instance and show it if __name__ == "__main__": window = Window() gtk.main()