in client/securedrop_client/app.py [0:0]
def start_app(args, qt_args) -> NoReturn: # type: ignore[no-untyped-def]
"""
Create all the top-level assets for the application, set things up and
run the application. Specific tasks include:
- set up locale and language.
- set up logging.
- create an application object.
- create a window for the app.
- create an API connection to the SecureDrop proxy.
- create a SqlAlchemy session to local storage.
- configure the client (logic) object.
- ensure the application is setup in the default safe starting state.
"""
os.umask(0o077)
configure_locale_and_language()
init(args.sdc_home)
configure_logging(args.sdc_home)
logging.info(f"Starting {SDC_NAME} {__version__}")
app = QApplication(qt_args)
app.setApplicationName(SDC_NAME)
app.setDesktopFileName(DESKTOP_FILE_NAME)
app.setApplicationVersion(__version__)
app.setAttribute(Qt.AA_UseHighDpiPixmaps)
prevent_second_instance(app, args.sdc_home)
session_maker = make_session_maker(args.sdc_home)
session = session_maker()
database = Database(session)
app_state = state.State(database)
with threads(3) as [
sync_thread,
main_queue_thread,
file_download_queue_thread,
]:
gui = Window(app_state)
controller = Controller(
"http://localhost:8081/",
gui,
session_maker,
args.sdc_home,
app_state,
not args.no_proxy,
not args.no_qubes,
sync_thread,
main_queue_thread,
file_download_queue_thread,
)
controller.setup()
configure_signal_handlers(app)
timer = QTimer()
timer.start(500)
timer.timeout.connect(lambda: None)
sys.exit(app.exec_())