QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads, True) from PyQt5.QtWidgets import QApplication app = QApplication(sys.argv) app.setOrganizationName("Deepin") app.setApplicationName("Deepin Screenshot") app.setApplicationVersion("3.1.0") app.setQuitOnLastWindowClosed(False) from app_controller import AppController from dbus_services import is_service_exist, register_object from dbus_interfaces import screenshotInterface if __name__ == "__main__": if is_service_exist(): screenshotInterface.runWithArguments(app.arguments()) # TODO: maybe there will never be a situation that # the following should be executed. # notificationsInterface.notify(_("Deepin Screenshot"), # _("Deepin Screenshot has been started!")) else: controller = AppController() returncode = controller.runWithArguments(app.arguments()) if returncode == 0: register_object(controller) signal.signal(signal.SIGINT, signal.SIG_DFL) sys.exit(app.exec_()) else: sys.exit(1)
from app_controller import AppController from flask import Flask, redirect, render_template, request, url_for app_ctrl = AppController() app = Flask(__name__) @app.route("/user/login", methods=["POST"]) def login(): args = request.args email = str(args['email']) password = str(args['password']) token_id = app_ctrl.sign_in(email=email, password=password) if token_id != None: return {'request': 'login', 'status': True, 'token': token_id} else: return { 'request': url_for('login'), 'status': False, 'token': token_id } @app.route("/user/sign_up", methods=["POST"]) def sign_up(): args = request.args name = args['name'] email = args['email'] password = args['password']
from app_controller import AppController run = AppController() run.start()
from PyQt5 import QtCore from PyQt5.QtCore import QCoreApplication if os.name == 'posix': QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads, True) from PyQt5.QtWidgets import QApplication app = QApplication(sys.argv) app.setOrganizationName("Deepin") app.setApplicationName("Deepin Screenshot") app.setApplicationVersion("3.0") app.setQuitOnLastWindowClosed(False) from app_controller import AppController from dbus_services import is_service_exist, register_object from dbus_interfaces import screenshotInterface if __name__ == "__main__": if is_service_exist(): screenshotInterface.runWithArguments(app.arguments()) # TODO: maybe there will never be a situation that # the following should be executed. # notificationsInterface.notify(_("Deepin Screenshot"), # _("Deepin Screenshot has been started!")) else: controller = AppController() controller.runWithArguments(app.arguments()) register_object(controller) signal.signal(signal.SIGINT, signal.SIG_DFL) sys.exit(app.exec_())
from app_controller import AppController print("CRIANDO INSTÂNCIA DE AppController") ac = AppController() print("Escolha um método pra testar:") print("\t1-sign_in\n\t2-sign_up\n\t3-sign_up_confirmation\n\t4-jump_to_next_client_in_queue\n\t5-search_for_queues") print("\t6-entry_on_queue\n\t7-search_for_queues_where_i_am\n\t8-exit_from_queue") print("\t9-update_profile_name\n\t10-update_profile_email\n\t11-update_profile_password") option = input(">> ") if option.lower() == '1': print("TESTANDO MÉTODO sign_in") email = input("Seu email de login: "******"Sua senha de login: "******"RESPOSTA DA CHAMADA A sign_in:",r) elif option.lower() == '2': print("TESTANDO MÉTODO sign_up") name = input("Seu nome: ") email = input("Seu email: ") password = input("Sua senha: ") is_stabilishment = input("É um estabelecimento? ") is_stabilishment = is_stabilishment.lower() == 's' r = ac.sign_up(name=name,email=email,password=password,is_stabilishment=is_stabilishment) print("RESPOSTA DA CHAMADA A sign_up:",r) elif option.lower() == '3': print("TESTANDO MÉTODO sign_up_confirmation")