示例#1
0
文件: preview.py 项目: gpa14/enki
 def __init__(self):
     QThread.__init__(self)
     self._queue = queue.Queue()
     self.start(QThread.LowPriority)
     self._ac = AsyncController('QThread', self)
     self._ac.defaultPriority = QThread.LowPriority
     self._SphinxInvocationCount = 1
示例#2
0
    def __init__(self, courseName, banList, sock):
        QThread.__init__(self)

        self.courseName = courseName
        self.banList = banList
        self.sock = sock
        self.pid = os.getpid()
        self.connecList = []

        self.clientOS = platform.system()
        self.tempIndex = 0

        self.ext = ''
        self.thispid = os.getpid()

        if self.clientOS == config.config.OS_WINDOWS:
            self.dirSeperator = config.config.WINDOWS_DIRECTORY_SEPARATOR
            self.ext = '.exe'

        else:
            self.dirSeperator = config.config.LINUX_DIRECTORY_SEPARATOR

        try:
            self.pre_check()
            time.sleep(1)

        except Exception as e:
            print(e)
示例#3
0
 def __init__(self, countchannel, triggerchannel, binwidth, roistart, roistop, filename=None, parent = None, FPGASerial="A6VTOYBO"):
     QThread.__init__(self, parent)
     self.channel = countchannel
     self.triggerchannel = triggerchannel
     self.binwidth = binwidth
     self.roistart = roistart
     self.roistop = roistop
     self.numberOfBins = (roistop-roistart)/binwidth+1
     self.histogram = numpy.zeros(self.numberOfBins)
     self.exiting = False
     self.crc8 = crcmod.mkCrcFun(poly=0x107, initCrc=0xff, xorOut=0x00, rev=False)
     self.Connection = ftd2xx.openEx(FPGASerial);
     self.Connection.setBaudRate(3000000)
     self.Connection.setDataCharacteristics(8, 0, 0)
     self.Connection.setFlowControl(0, 0, 0)
     self.Connection.setTimeouts(500, 500)
     self.Connection.resetDevice()
     self.Connection.purge()
     self.integration_time = 100.0;
     command = struct.pack('>BBBI', 0x10, 0, 0x11, int(500*50000 )  )
     self.Connection.write(command)    
     command = struct.pack('>BB', 0x12, 0x0  )
     self.Connection.write(command)    
     self.Mutex = QMutex()
     self.filename = filename
     self.binfile = None
     if self.filename is not None:
         self.binfile = open(self.filename, 'wb')
     self.clearStatus()
     self.maxPretriggerPhotons = 1000000
示例#4
0
 def __init__(self, BluetoothMetadata):
     QThread.__init__(self)
     self.btmd = BluetoothMetadata
     self.isRunning = True
     self.currArtist = ""
     self.currAlbum = ""
     self.currTitle = ""
示例#5
0
 def __init__(self, panel, tconfig):
     QThread.__init__(self)
     self.local_dpy = display.Display()
     self.record_dpy = display.Display()
     self.tconfig = tconfig
     self.panel = panel
     self.keymap = self.tconfig.focus_keymap
     self.received_keys = list()
示例#6
0
 def __init__(self, view, function, message=None,
              on_end_function=None, on_exception_function=None):
     QThread.__init__(self)
     self._view = view
     self._function = function
     self._message = message
     self._on_end_function = on_end_function
     self._on_exception_function = on_exception_function
示例#7
0
 def __init__(self, accurate_url, city, suffix, parent=None):
     QThread.__init__(self, parent)
     self.accurate_url = accurate_url
     # Search in any language
     self.city = city  # self.encode_utf8(city)
     self.suffix = suffix
     self.tentatives = 1
     self.settings = QSettings()
示例#8
0
 def __init__(self, wm, processor):
     self.event_queue = list()
     self._processor = processor
     self.notifier = Notifier(wm, NinjaProcessEvent(
         self.event_queue.append))
     self.notifier.coalesce_events(True)
     self.keep_running = True
     QThread.__init__(self)
示例#9
0
    def __init__(self, map_queue, exchange_queues, map_limits):

        QThread.__init__(self)
        self.map_queue = map_queue
        self.exchange_queues = exchange_queues
        self.map_limits = map_limits
        
        self.speed = 0.01  # In seconds
示例#10
0
文件: engine.py 项目: ohAitch/plover
 def __init__(self, config, keyboard_emulation):
     StenoEngine.__init__(self, config, keyboard_emulation)
     QThread.__init__(self)
     self._signals = {}
     for hook in self.HOOKS:
         signal = getattr(self, 'signal_' + hook)
         self.hook_connect(hook, signal.emit)
         self._signals[hook] = signal
    def __init__(self, input):
        QThread.__init__(self)

        self._input = input
        self._read_timer = QTimer()
        self._read_timer.setInterval(25)

        self._read_timer.timeout.connect(self._read_input)
示例#12
0
    def __init__(self, parent = None):
        QThread.__init__(self, parent)

        self.problemMap = None
        self.population = None
        self.selector = None
        self.crosser = None
        self.mutator = None
示例#13
0
 def __init__(self, urlin, pathin, token, type, progress,  options):
     QThread.__init__(self)
     self.urlin = urlin
     self.pathin = pathin
     self.token = token
     self.type = type
     self.progressBar = progress
     self.options = options
示例#14
0
    def __init__(self, port, baudrate, parent=None):
        QThread.__init__(self, parent)

        self.port = port
        self.baudrate = baudrate
        self.serial_connection = None
        self.exiting = False
        self.matrix = None
示例#15
0
 def __init__(self, settings, coms, script, parent=None):
     QThread.__init__(self, parent)
     self.settings = settings
     self.coms = coms
     self.coms.pump_off()
     self.pump = False
     self.program = [step for step in map(Steps.parse, script) if step]
     self.current_step = None
     self.to_pause = False
示例#16
0
文件: main.py 项目: MissiaL/AzkLoader
 def __init__(self, files, destination, extr, shema=None, password=None, port=None, report=False):
     QThread.__init__(self)
     self.files = files
     self.destination = destination
     self.extr = extr
     self.report = report
     self.shema = shema
     self.password = password
     self.port = port
示例#17
0
 def __init__(self, functionInit=None, args=None, kwargs=None):
     super(ThreadExecution, self).__init__()
     QThread.__init__(self)
     self.execute = functionInit
     self.result = None
     self.storage_values = None
     self.args = args if args is not None else []
     self.kwargs = kwargs if kwargs is not None else {}
     self.signal_return = None
示例#18
0
 def __init__(self, reader, email_user,
              email_pass, subject, no_reply, communicate, body):
     QThread.__init__(self)
     self.reader = reader
     self.email_user = email_user
     self.email_pass = email_pass
     self.subject = subject
     self.no_reply = no_reply
     self.communicate = communicate
     self.body = body
示例#19
0
 def __init__(self, icon_url, icon, parent=None):
     QThread.__init__(self, parent)
     self.icon_url = icon_url
     self.icon = icon
     self.tentatives = 0
     # Some times server sends less data
     self.periods = 6
     periods = len(self.icon)
     if periods < 6:
         self.periods = periods
     self.settings = QSettings()
示例#20
0
 def __init__(self,params):
     #params [studyNumber,animalNumber,leftLever,RightLever,lEnable,rEnable,success#]
     #vars [leftLever,rightLever,success,total,time]
     self.params = params
     self.parmchange = False
     QThread.__init__(self)
     self.mutex = QMutex()
     self.running = True
     self.task = LeverTask(params)
     self.index = 0
     self.indexChanged = True
    def __init__(self, parent, action, callback=None, args=[], kwargs={}, exceptionHandler=None):
        QThread.__init__(self, parent)

        if callback:
            parent.connect(self, SIGNAL("finished()"), callback)  # FIXME

        self.action = action
        self.args = args
        self.kwargs = kwargs
        self.exceptionHandler = exceptionHandler
        self.data = None
示例#22
0
 def __init__(self, iconurl, baseurl, forecast_url, day_forecast_url, id_,
              suffix, parent=None):
     QThread.__init__(self, parent)
     self.wIconUrl = iconurl
     self.baseurl = baseurl
     self.forecast_url = forecast_url
     self.day_forecast_url = day_forecast_url
     self.id_ = id_
     self.suffix = suffix
     self.tentatives = 0
     self.settings = QSettings()
示例#23
0
 def __init__(self):
     """
     Initialize everything
     """
     self.logger = MyLogger("PQDispatcher")
     QThread.__init__(self)
     self.syncTasks = []
     # self.threadPool = Pool(processes=2)
     # self.threads = []
     self.isExecuting = False
     # self.timer = QTimer()
     self.stop = False
示例#24
0
    def __init__(self, parent):
        QThread.__init__(self, parent)

        self.fCloseNow   = False
        self.fPurgeLogs  = False
        self.fRealParent = parent

        # -------------------------------------------------------------
        # Take some values from Logs Window

        self.LOG_FILE_JACK   = LogsW.LOG_FILE_JACK
        self.LOG_FILE_A2J    = LogsW.LOG_FILE_A2J
        self.LOG_FILE_LASH   = LogsW.LOG_FILE_LASH
        self.LOG_FILE_LADISH = LogsW.LOG_FILE_LADISH

        # -------------------------------------------------------------
        # Init logs

        if self.LOG_FILE_JACK is not None:
            self.fLogFileJACK = QFile(self.LOG_FILE_JACK)
            self.fLogFileJACK.open(QIODevice.ReadOnly)
            self.fLogStreamJACK = QTextStream(self.fLogFileJACK)
            self.fLogStreamJACK.setCodec("UTF-8")

            if self.fLogFileJACK.size() > self.MAX_INITIAL_SIZE:
                self.fLogStreamJACK.seek(self.fLogFileJACK.size() - self.MAX_INITIAL_SIZE)

        if self.LOG_FILE_A2J is not None:
            self.fLogFileA2J = QFile(self.LOG_FILE_A2J)
            self.fLogFileA2J.open(QIODevice.ReadOnly)
            self.fLogStreamA2J = QTextStream(self.fLogFileA2J)
            self.fLogStreamA2J.setCodec("UTF-8")

            if self.fLogFileA2J.size() > self.MAX_INITIAL_SIZE:
                self.fLogStreamA2J.seek(self.fLogFileA2J.size() - self.MAX_INITIAL_SIZE)

        if self.LOG_FILE_LASH is not None:
            self.fLogFileLASH = QFile(self.LOG_FILE_LASH)
            self.fLogFileLASH.open(QIODevice.ReadOnly)
            self.fLogStreamLASH = QTextStream(self.fLogFileLASH)
            self.fLogStreamLASH.setCodec("UTF-8")

            if self.fLogFileLASH.size() > self.MAX_INITIAL_SIZE:
                self.fLogStreamLASH.seek(self.fLogFileLASH.size() - self.MAX_INITIAL_SIZE)

        if self.LOG_FILE_LADISH is not None:
            self.fLogFileLADISH = QFile(self.LOG_FILE_LADISH)
            self.fLogFileLADISH.open(QIODevice.ReadOnly)
            self.fLogStreamLADISH = QTextStream(self.fLogFileLADISH)
            self.fLogStreamLADISH.setCodec("UTF-8")

            if self.fLogFileLADISH.size() > self.MAX_INITIAL_SIZE:
                self.fLogStreamLADISH.seek(self.fLogFileLADISH.size() - self.MAX_INITIAL_SIZE)
示例#25
0
    def __init__(self, parent, action, callback=None, \
                 args=[], kwargs={}, exceptionHandler=None):
        QThread.__init__(self,parent)

        if callback:
            parent.finished.connect(callback)

        self.action = action
        self.args = args
        self.kwargs = kwargs
        self.exceptionHandler = exceptionHandler
        self.data = None
示例#26
0
文件: microbit.py 项目: opt9/mu
 def __init__(self, paths_to_microbits, python_script, path_to_runtime):
     """
     The paths_to_microbits should be a list containing filesystem paths to
     attached micro:bits to flash. The python_script should be the text of
     the script to flash onto the device. The path_to_runtime should be the
     path of the hex file for the MicroPython runtime to use. If the
     path_to_runtime is None, the default MicroPython runtime is used by
     default.
     """
     QThread.__init__(self)
     self.paths_to_microbits = paths_to_microbits
     self.python_script = python_script
     self.path_to_runtime = path_to_runtime
示例#27
0
    def __init__(self, parent=None):
        QThread.__init__(self, parent)

        self.fApplication = Application(
            [
                (r"/effect/get/?", EffectGet),
                (r"/effect/file/(.*)", EffectFile),
                (r"/resources/(.*)", EffectResource),
                (r"/(.*)", StaticFileHandler, {"path": HTML_DIR}),
            ],
            debug=True)

        self.fPrepareWasCalled = False
示例#28
0
 def __init__(self, parent=None):
     """Constructor."""
     QThread.__init__(self, parent)
     self.parent = parent
     self.video = video
     self.plugin_files = []
     self.archive = None
     self.filepath = None
     self.filename = None
     self.library_path = None
     self.state = M64EMU_STOPPED
     self.settings = self.parent.settings
     self.core = Core()
示例#29
0
 def __init__(self, QObject_parent=None):
     """
     @type serial_port: serial.Serial
     @type queue: queue.Queue
     """
     QThread.__init__(self, QObject_parent)
     self.queue = Queue()
     self.current_message_number = 0
     self.last_cleared_message_number = None
     self.__abort = False
     self.message_buffer_slots = [None] * 3
     self.reset_send_buffer_lock = Lock()
     self.full_buffer_wait_condition = Condition(self.reset_send_buffer_lock)
示例#30
0
    def __init__(self, phone, password, parent=None, debug=False):
        QThread.__init__(self, parent)
        self.exiting = False
        self.interface = Interfacer()
        if debug:
            logging.basicConfig(level=logging.DEBUG)

        stack_builder = YowStackBuilder()

        self.stack = stack_builder\
            .pushDefaultLayers(True)\
            .push(self.interface)\
            .build()
        self.stack.setCredentials([phone, password])
 def __init__(self, parent, verbose=False):
     QThread.__init__(self, parent)
     self.parent = parent
     self.verbose = verbose
     self.keepAlive = True
     self.parent.signalToWorker.connect(self.getSignal)
 def __init__(self, cli, name, path, dockerfile):
     QThread.__init__(self)
     self.docker = cli
     self.dockerfile = dockerfile
     self.name = name
     self.buildpath = path
示例#33
0
 def __init__(self, srcAddress, dstAddress, mac):
     QThread.__init__(self)
     self.srcAddress = srcAddress
     self.dstAddress = dstAddress
     self.mac = mac
     self.process = True
示例#34
0
 def __init__(self, parent, folder):
     QThread.__init__(self)
     self.parent = parent
     self.folder = Path(folder)
示例#35
0
 def __init__(self, add_link_dictionary):
     QThread.__init__(self)
     self.add_link_dictionary = add_link_dictionary
示例#36
0
 def __init__(self, unsorted_points, demo):
     self.points = unsorted_points
     self.pause = demo
     QThread.__init__(self)
示例#37
0
 def __init__(self):
     QThread.__init__(self)
     timer2.timeout.connect(self.pintar)
     timer2.setSingleShot(False)
     timer2.start(1)
示例#38
0
 def __init__(self, uiObj):
     QThread.__init__(self)
     self.mainUI = uiObj
示例#39
0
 def __init__(self, parent=None):
     QThread.__init__(self, parent)
     self.exiting = False
     self.ewmh = EWMH()
     self.active_window_id_tree = []
示例#40
0
 def __init__(self, link_url: str, dl_path: str):
     QThread.__init__(self)
     self.download_link = link_url
     self.download_path = dl_path
     self.cancel_download = False
     self.proxies = ShadowSocks.proxies()
示例#41
0
 def __init__(self, link_url: str, useragent: str):
     QThread.__init__(self)
     self.link_url = link_url
     self.user_agent = useragent
     self.scraper = cloudscraper.create_scraper()
     self.scraper.proxies = ShadowSocks.proxies()
示例#42
0
 def __init__(self):
     QThread.__init__(self)
     self._stop_event = threading.Event()
示例#43
0
 def __init__(self, steamExePath, conanParameters, parent=None):
     QThread.__init__(self)
     self.steamExePath = steamExePath
     self.conanParameters = conanParameters
     self.runs = True
示例#44
0
 def __init__(self, mode):
     QThread.__init__(self, parent=None)
     self.mode = mode
     print(self.mode)
示例#45
0
 def __init__(self):
     QThread.__init__(self)
     self.runs = True
示例#46
0
 def __init__(self, m_mainWindow, parent=None):
     QThread.__init__(self, parent)
     self.m = m_mainWindow
示例#47
0
 def __init__(self):
     QThread.__init__(self)
     Logger.__init__(self)
     self.network = Network.get_instance()
示例#48
0
 def __init__(self, resource='/'):
     QThread.__init__(self)
     self._url = 'http://186.249.222.195'
     self._resource = resource
示例#49
0
    def __init__(self):
        QThread.__init__(self)
        DeviceInfoThread.friend_device_info.append(DeviceInfo(None, None))

        setattr(self.friend_device_info[0], 'd_boot_t', self.get_my_booting_time())
        setattr(self.friend_device_info[0], 'd_name', socket.gethostname())
 def __init__(self,  event):
     QThread.__init__(self)
     self.stopped = event
     self.altValue = 0
示例#51
0
        def __init__(self, downloader):
            QThread.__init__(self)

            self.downloader = downloader
示例#52
0
 def __init__(self, parent=None):
     QThread.__init__(self, parent)
示例#53
0
 def __init__(self):
     QThread.__init__(self)
 def __init__(self,  event):
     QThread.__init__(self)
     self.stopped = event
示例#55
0
 def __init__(self):
     QThread.__init__(self)
     # self.signal.connect(parent.getData)
     print("Init Thread")
示例#56
0
 def __init__(self, parent=None):
     QThread.__init__(self, parent)
     qpopplerview.printer.Printer.__init__(self)
     self.success = None
示例#57
0
 def __init__(self, sc):
     QThread.__init__(self)
     self.sc = sc
 def __init__(self, cli, name, version):
     QThread.__init__(self)
     self.docker = cli
     self.name = name
     self.version = version
示例#59
0
 def __init__(self, selector, parent=None):
     QThread.__init__(self, parent)
     EventObserver.__init__(self)
     self.selector = selector
     self.selector.register(self)
示例#60
0
 def __init__(self, interface):
     QThread.__init__(self)
     self.interface = interface
     self.process = True