Ejemplo n.º 1
0
 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
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 4
0
 def __init__(self, BluetoothMetadata):
     QThread.__init__(self)
     self.btmd = BluetoothMetadata
     self.isRunning = True
     self.currArtist = ""
     self.currAlbum = ""
     self.currTitle = ""
Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 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()
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 10
0
 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 16
0
 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 26
0
Archivo: microbit.py Proyecto: 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
Ejemplo n.º 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
Ejemplo n.º 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()
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 33
0
 def __init__(self, srcAddress, dstAddress, mac):
     QThread.__init__(self)
     self.srcAddress = srcAddress
     self.dstAddress = dstAddress
     self.mac = mac
     self.process = True
Ejemplo n.º 34
0
 def __init__(self, parent, folder):
     QThread.__init__(self)
     self.parent = parent
     self.folder = Path(folder)
Ejemplo n.º 35
0
 def __init__(self, add_link_dictionary):
     QThread.__init__(self)
     self.add_link_dictionary = add_link_dictionary
Ejemplo n.º 36
0
 def __init__(self, unsorted_points, demo):
     self.points = unsorted_points
     self.pause = demo
     QThread.__init__(self)
Ejemplo n.º 37
0
 def __init__(self):
     QThread.__init__(self)
     timer2.timeout.connect(self.pintar)
     timer2.setSingleShot(False)
     timer2.start(1)
Ejemplo n.º 38
0
 def __init__(self, uiObj):
     QThread.__init__(self)
     self.mainUI = uiObj
Ejemplo n.º 39
0
 def __init__(self, parent=None):
     QThread.__init__(self, parent)
     self.exiting = False
     self.ewmh = EWMH()
     self.active_window_id_tree = []
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 42
0
 def __init__(self):
     QThread.__init__(self)
     self._stop_event = threading.Event()
Ejemplo n.º 43
0
 def __init__(self, steamExePath, conanParameters, parent=None):
     QThread.__init__(self)
     self.steamExePath = steamExePath
     self.conanParameters = conanParameters
     self.runs = True
Ejemplo n.º 44
0
 def __init__(self, mode):
     QThread.__init__(self, parent=None)
     self.mode = mode
     print(self.mode)
Ejemplo n.º 45
0
 def __init__(self):
     QThread.__init__(self)
     self.runs = True
Ejemplo n.º 46
0
 def __init__(self, m_mainWindow, parent=None):
     QThread.__init__(self, parent)
     self.m = m_mainWindow
Ejemplo n.º 47
0
 def __init__(self):
     QThread.__init__(self)
     Logger.__init__(self)
     self.network = Network.get_instance()
Ejemplo n.º 48
0
 def __init__(self, resource='/'):
     QThread.__init__(self)
     self._url = 'http://186.249.222.195'
     self._resource = resource
Ejemplo n.º 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
Ejemplo n.º 51
0
        def __init__(self, downloader):
            QThread.__init__(self)

            self.downloader = downloader
Ejemplo n.º 52
0
 def __init__(self, parent=None):
     QThread.__init__(self, parent)
Ejemplo n.º 53
0
 def __init__(self):
     QThread.__init__(self)
 def __init__(self,  event):
     QThread.__init__(self)
     self.stopped = event
Ejemplo n.º 55
0
 def __init__(self):
     QThread.__init__(self)
     # self.signal.connect(parent.getData)
     print("Init Thread")
Ejemplo n.º 56
0
 def __init__(self, parent=None):
     QThread.__init__(self, parent)
     qpopplerview.printer.Printer.__init__(self)
     self.success = None
Ejemplo n.º 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
Ejemplo n.º 59
0
 def __init__(self, selector, parent=None):
     QThread.__init__(self, parent)
     EventObserver.__init__(self)
     self.selector = selector
     self.selector.register(self)
Ejemplo n.º 60
0
 def __init__(self, interface):
     QThread.__init__(self)
     self.interface = interface
     self.process = True