Exemple #1
0
#                                                                   #
# Copyright 2013, Monash University                                 #
#                                                                   #
# This file is part of the program BLACS, in the labscript suite    #
# (see http://labscriptsuite.org), and is licensed under the        #
# Simplified BSD License. See the license.txt file in the root of   #
# the project for the full license.                                 #
#                                                                   #
#####################################################################
import labscript_utils.excepthook

import os

# Associate app windows with OS menu shortcuts:
import desktop_app
desktop_app.set_process_appid('blacs')


# Splash screen
from labscript_utils.splash import Splash
splash = Splash(os.path.join(os.path.dirname(__file__), 'blacs.svg'))
splash.show()

splash.update_text('importing standard library modules')
import subprocess
import sys
import time
from pathlib import Path
import platform
WINDOWS = platform.system() == 'Windows'
Exemple #2
0
import traceback
import time
from types import ModuleType

from qtutils.qt import QtCore, QtGui, QtWidgets
from qtutils.qt.QtCore import pyqtSignal as Signal
from qtutils.qt.QtCore import pyqtSlot as Slot

from qtutils import inmain, inmain_later, inmain_decorator, UiLoader, inthread, DisconnectContextManager
import qtutils.icons

import multiprocessing

# Associate app windows with OS menu shortcuts:
import desktop_app
desktop_app.set_process_appid('lyse')

# This process is not fork-safe. Spawn fresh processes on platforms that would fork:
if (hasattr(multiprocessing, 'get_start_method')
        and multiprocessing.get_start_method(True) != 'spawn'):
    multiprocessing.set_start_method('spawn')


class PlotWindowCloseEvent(QtGui.QCloseEvent):
    def __init__(self, force, *args, **kwargs):
        QtGui.QCloseEvent.__init__(self, *args, **kwargs)
        self.force = force


class PlotWindow(QtWidgets.QWidget):
    # A signal for when the window manager has created a new window for this widget:
Exemple #3
0
import sys
import tkinter
import desktop_app

desktop_app.set_process_appid("oink")


def main():
    root = tkinter.Tk(className=sys.argv[0])
    root.geometry("500x300")
    w = tkinter.Label(root, text="Oink!")
    w.place(relx=0.5, rely=0.3, anchor=tkinter.CENTER)
    sys_info = (f"sys.prefix: {sys.prefix}\n"
                f"sys.exec_prefix: {sys.exec_prefix}\n"
                f"sys.executable: {sys.executable}")
    s = tkinter.Label(root, text=sys_info, justify=tkinter.LEFT)
    s.place(relx=0.05, rely=0.5, anchor=tkinter.W)
    print(sys_info)
    root.mainloop()


if __name__ == "__main__":
    main()