def __init__(self): """Download API based on requests.""" super(QObject, self).__init__() self._conda_api = CondaAPI() self._client_api = ClientAPI() self._queue = deque() self._queue_workers = deque() self._threads = [] self._workers = [] self._timer = QTimer() self._timer_worker_delete = QTimer() self._running_threads = 0 self._bag_collector = deque() # Keeps references to old workers self._chunk_size = 1024 self._timer.setInterval(333) self._timer.timeout.connect(self._start) self._timer_worker_delete.setInterval(5000) self._timer_worker_delete.timeout.connect(self._clean_workers)
def __init__(self, name, topic, addr, parent=None): super(AreaDetWidget, self).__init__(parent) self.name = name self.topic = topic self.comm_handler = AsyncGraphCommHandler(addr.name, addr.comm) self.timer = QTimer() self.timer.timeout.connect(self.get_image) self.timer.start(1000) self.roi.sigRegionChangeFinished.connect(self.roi_updated) self.roiUpdate.connect(self.roi_updated_async)
def __init__(self, editor): super(TextDecorationsManager, self).__init__(editor) QObject.__init__(self, None) self._decorations = [] # Timer to not constantly update decorations. self.update_timer = QTimer(self) self.update_timer.setSingleShot(True) self.update_timer.setInterval(UPDATE_TIMEOUT) self.update_timer.timeout.connect(self._update)
def __init__(self): super(Clock, self).__init__() # set initial values self.time.setValue(datetime.now()) self.date.setValue(datetime.now()) # make the clock tick self.timer = QTimer() self.timer.timeout.connect(self.tick)
def __init__(self, name, topic, addr, parent=None): super(__class__, self).__init__(parent) self.name = name self.topic = topic self.timer = QTimer() self.comm_handler = AsyncGraphCommHandler(addr.name, addr.comm) self.plot_view = self.addPlot() self.plot = None self.timer.timeout.connect(self.get_waveform) self.timer.start(1000)
def run(): app = QApplication.instance() or QApplication([]) viewer = napari.Viewer() timer = QTimer() timer.setInterval(500) timer.timeout.connect(viewer.window.close) timer.timeout.connect(app.quit) timer.start() display(stack, spots, masks, viewer=viewer) app.exec_()
def __init__(self, parent, centerOnParent=True, disableParentWhenSpinning=False, modality=Qt.NonModal, roundness=100., fade=80., lines=20, line_length=10, line_width=2, radius=10, speed=math.pi / 2): super().__init__(parent) self._centerOnParent = centerOnParent self._disableParentWhenSpinning = disableParentWhenSpinning self._color = QColor(0, 0, 0) self._roundness = roundness self._minimumTrailOpacity = math.pi self._trailFadePercentage = fade self._oldTrailFadePercentage = fade self._revolutionsPerSecond = speed self._numberOfLines = lines self._lineLength = line_length self._lineWidth = line_width self._innerRadius = radius self._currentCounter = 0 self._isSpinning = False self.fadeInTimer = QTimer() self.fadeOutTimer = QTimer() self._timer = QTimer(self) self._timer.timeout.connect(self.rotate) self.updateSize() self.updateTimer() self.hide() self.setWindowModality(modality) self.setAttribute(Qt.WA_TranslucentBackground) self.setColor(qrainbowstyle.getCurrentPalette().COLOR_ACCENT_4)
def start(self) -> None: """ Creating the QTimer to check for connection every second, and starting it. """ self.attempts = self.MAX_ATTEMPTS self.timer = QTimer(self) self.timer.timeout.connect(self.try_connection) self.timer.start(self.INTERVAL)
def __init__(self, servo): QObject.__init__(self) self._servo = servo self._watched = {} self._running = False self._timer = QTimer() self._timer.timeout.connect(self.onTimerExpired)
def __init__(self, parent, batch_manager): QWidget.__init__(self, parent) self.calculation_manager = batch_manager self.whole_progress = QProgressBar(self) self.whole_progress.setMinimum(0) self.whole_progress.setMaximum(1) self.whole_progress.setFormat("%v of %m") self.whole_progress.setTextVisible(True) self.part_progress = QProgressBar(self) self.part_progress.setMinimum(0) self.part_progress.setMaximum(1) self.part_progress.setFormat("%v of %m") self.whole_label = QLabel("All batch progress:", self) self.part_label = QLabel("Single batch progress:", self) self.logs = ExceptionList(self) self.logs.setToolTip("Logs") self.task_que = QListWidget() self.process_num_timer = QTimer() self.process_num_timer.setInterval(1000) self.process_num_timer.setSingleShot(True) self.process_num_timer.timeout.connect(self.change_number_of_workers) self.number_of_process = QSpinBox(self) self.number_of_process.setRange(1, multiprocessing.cpu_count()) self.number_of_process.setValue(1) self.number_of_process.setToolTip("Number of process used in batch calculation") self.number_of_process.valueChanged.connect(self.process_num_timer_start) layout = QGridLayout() layout.addWidget(self.whole_label, 0, 0, Qt.AlignRight) layout.addWidget(self.whole_progress, 0, 1, 1, 2) layout.addWidget(self.part_label, 1, 0, Qt.AlignRight) layout.addWidget(self.part_progress, 1, 1, 1, 2) lab = QLabel("Number of process:") lab.setToolTip("Number of process used in batch calculation") layout.addWidget(lab, 2, 0) layout.addWidget(self.number_of_process, 2, 1) layout.addWidget(self.logs, 3, 0, 1, 3) layout.addWidget(self.task_que, 0, 4, 0, 1) layout.setColumnMinimumWidth(2, 10) layout.setColumnStretch(2, 1) self.setLayout(layout) self.preview_timer = QTimer() self.preview_timer.setInterval(1000) self.preview_timer.timeout.connect(self.update_info)
def __init__(self, ui_file=None, command_line_args=[], display_args=[], perfmon=False, hide_nav_bar=False, hide_menu_bar=False, hide_status_bar=False, read_only=False, macros=None, use_main_window=True, stylesheet_path=None, fullscreen=False): super(PyDMApplication, self).__init__(command_line_args) # Enable High DPI display, if available. if hasattr(Qt, 'AA_UseHighDpiPixmaps'): self.setAttribute(Qt.AA_UseHighDpiPixmaps) # The macro and directory stacks are needed for nested displays (usually PyDMEmbeddedDisplays). # During the process of loading a display (whether from a .ui file, or a .py file), the application's # 'open_file' method will be called recursively. Inside open_file, the last item on the stack represents # the parent widget's file path and macro variables. Any file paths are joined to the end of the parent's # file path, and any macros are merged with the parent's macros. This system depends on open_file always # being called hierarchially (i.e., parent calls it first, then on down the ancestor tree, with no unrelated # calls in between). If something crazy happens and PyDM somehow gains the ability to open files in a # multi-threaded way, for example, this system will fail. data_plugins.set_read_only(read_only) self.main_window = None self.directory_stack = [''] self.macro_stack = [{}] self.windows = {} self.display_args = display_args self.hide_nav_bar = hide_nav_bar self.hide_menu_bar = hide_menu_bar self.hide_status_bar = hide_status_bar self.fullscreen = fullscreen # Open a window if required. if ui_file is not None: self.make_main_window(stylesheet_path=stylesheet_path) self.make_window(ui_file, macros, command_line_args) elif use_main_window: self.make_main_window(stylesheet_path=stylesheet_path) self.had_file = ui_file is not None # Re-enable sigint (usually blocked by pyqt) signal.signal(signal.SIGINT, signal.SIG_DFL) # Performance monitoring if perfmon: import psutil self.perf = psutil.Process() self.perf_timer = QTimer() self.perf_timer.setInterval(2000) self.perf_timer.timeout.connect(self.get_CPU_usage) self.perf_timer.start()
def __init__(self, parent: MainWindowBase): super(InputsWidget, self).__init__(parent) self.setupUi(self) # parent's function pointer self.free_move_button = parent.free_move_button self.entities_point = parent.entities_point self.entities_link = parent.entities_link self.vpoints = parent.vpoint_list self.vlinks = parent.vlink_list self.main_canvas = parent.main_canvas self.solve = parent.solve self.reload_canvas = parent.reload_canvas self.output_to = parent.output_to self.conflict = parent.conflict self.dof = parent.dof self.right_input = parent.right_input self.command_stack = parent.command_stack self.set_coords_as_current = parent.set_coords_as_current self.get_back_position = parent.get_back_position # Angle panel self.dial = QRotatableView(self) self.dial.setStatusTip("Input widget of rotatable joint.") self.dial.setEnabled(False) self.dial.value_changed.connect(self.__update_var) self.dial_spinbox.valueChanged.connect(self.__set_var) self.inputs_dial_layout.insertWidget(0, self.dial) # Play button self.variable_stop.clicked.connect(self.variable_value_reset) # Timer for play button self.inputs_play_shaft = QTimer() self.inputs_play_shaft.setInterval(10) self.inputs_play_shaft.timeout.connect(self.__change_index) # Change the point coordinates with current position self.update_pos.clicked.connect(self.set_coords_as_current) # Record list self.record_list.blockSignals(True) self.record_list.addItem(_AUTO_PATH) self.record_list.setCurrentRow(0) self.record_list.blockSignals(False) self.__paths = {_AUTO_PATH: self.main_canvas.path_preview} self.__slider_paths = { _AUTO_PATH: self.main_canvas.slider_path_preview } def slot(widget: QCheckBox) -> Callable[[int], None]: @Slot(int) def func(ind: int) -> None: widget.setEnabled(ind >= 0 and self.vpoints[ind].type != VJoint.R) return func # Slot option self.plot_joint.currentIndexChanged.connect(slot(self.plot_joint_slot)) self.wrt_joint.currentIndexChanged.connect(slot(self.wrt_joint_slot))
def __init__(self, parent=None, tags=None, content_urls=None): super(CommunityTab, self).__init__(parent) self._parent = parent self._downloaded_urls = [] self._downloaded_filepaths = [] self.api = AnacondaAPI() self.content_urls = content_urls self.content_info = [] self.step = 0 self.step_size = 1 self.tags = tags self.timer_load = QTimer() self.pixmaps = {} self.default_pixmap = QPixmap(VIDEO_ICON_PATH).scaled( 100, 60, Qt.KeepAspectRatio, Qt.FastTransformation) # Widgets self.text_filter = LineEditSearch() self.frame_community = FrameCommunity() self.list = ListWidgetContent() # Widget setup self.timer_load.setInterval(333) self.list.setAttribute(Qt.WA_MacShowFocusRect, False) self.text_filter.setPlaceholderText('Search') self.text_filter.setAttribute(Qt.WA_MacShowFocusRect, False) self.setObjectName("Tab") self.list.setMinimumHeight(200) fm = self.text_filter.fontMetrics() self.text_filter.setMaximumWidth(fm.width('M'*23)) # Layouts hlayout = QHBoxLayout() self.filters_layout = QHBoxLayout() layout = QVBoxLayout() layout.addLayout(hlayout) controls_layout = QHBoxLayout() controls_layout.addLayout(self.filters_layout) controls_layout.addStretch() controls_layout.addWidget(self.text_filter) layout.addLayout(controls_layout) layout.addWidget(self.list) self.frame_community.setLayout(layout) layout = QHBoxLayout() layout.addWidget(self.frame_community) self.setLayout(layout) # Signals self.timer_load.timeout.connect(self.set_content_list) self.text_filter.textChanged.connect(self.filter_content)
def main(argv=sys.argv): """ The majority of the code in this function was taken from start_glue() in main.py after a discussion with Tom Robataille. We wanted the ability to get command line arguments and use them in here and this seemed to be the cleanest way to do it. """ # Make sure the mosviz startup item is registered from .startup import mosviz_setup # noqa parser = argparse.ArgumentParser() parser.add_argument('data_files', nargs=argparse.REMAINDER) args = parser.parse_known_args(argv[1:]) import glue from glue.utils.qt import get_qapp app = get_qapp() # Splash screen splash = get_splash() splash.image = QtGui.QPixmap(MOSVIZ_SPLASH_PATH) splash.show() # Start off by loading plugins. We need to do this before restoring # the session or loading the configuration since these may use existing # plugins. load_plugins(splash=splash) datafiles = args[0].data_files # # Show the splash screen for 2 seconds timer = QTimer() timer.setInterval(2000) timer.setSingleShot(True) timer.timeout.connect(splash.close) timer.start() data_collection = glue.core.DataCollection() hub = data_collection.hub splash.set_progress(100) session = glue.core.Session(data_collection=data_collection, hub=hub) ga = GlueApplication(session=session) qapp = QtWidgets.QApplication.instance() ga.setWindowTitle('MOSViz v{0}'.format(__version__)) qapp.setWindowIcon(QtGui.QIcon(MOSVIZ_ICON_PATH)) ga.setWindowIcon(QtGui.QIcon(MOSVIZ_ICON_PATH)) # Load the data files. if datafiles: datasets = load_data_files(datafiles) ga.add_datasets(data_collection, datasets, auto_merge=False) ga.run_startup_action('mosviz') ga.start(maximized=True)
def __init__(self, vpoints: Sequence[VPoint], vlinks: Sequence[VLink], path: _Paths, slider_path: _SliderPaths, monochrome: bool, parent: QWidget): super(AnimateDialog, self).__init__(parent) self.setWindowTitle("Vector Animation") self.setWindowFlags(self.windowFlags() | Qt.WindowMaximizeButtonHint & ~Qt.WindowContextHelpButtonHint) self.setMinimumSize(800, 600) self.setModal(True) main_layout = QVBoxLayout(self) self.canvas = _DynamicCanvas(vpoints, vlinks, path, slider_path, self) self.canvas.set_monochrome_mode(monochrome) self.canvas.update_pos.connect(self.__set_pos) layout = QHBoxLayout(self) pt_option = QComboBox(self) pt_option.addItems([f"P{p}" for p in range(len(vpoints))]) layout.addWidget(pt_option) value_label = QLabel(self) @Slot(int) def show_values(ind: int): vel, vel_deg = self.canvas.get_vel(ind) acc, acc_deg = self.canvas.get_acc(ind) value_label.setText( f"Velocity: {vel:.04f} ({vel_deg:.04f}deg) | " f"Acceleration: {acc:.04f} ({acc_deg:.04f}deg)") pt_option.currentIndexChanged.connect(show_values) layout.addWidget(value_label) self.pos_label = QLabel(self) layout.addItem( QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)) layout.addWidget(self.pos_label) main_layout.addLayout(layout) main_layout.addWidget(self.canvas) layout = QHBoxLayout(self) self.play = QPushButton(QIcon(QPixmap(":/icons/play.png")), "", self) self.play.setCheckable(True) self.play.clicked.connect(self.__play) layout.addWidget(self.play) self.slider = QSlider(Qt.Horizontal, self) self.slider.setMaximum(max(len(p) for p in path) - 1) self.slider.valueChanged.connect(self.canvas.set_index) layout.addWidget(self.slider) layout.addWidget(QLabel("Total times:", self)) factor = QDoubleSpinBox(self) factor.valueChanged.connect(self.canvas.set_factor) factor.setSuffix('s') factor.setRange(0.01, 999999) factor.setValue(10) layout.addWidget(factor) main_layout.addLayout(layout) self.timer = QTimer() self.timer.setInterval(10) self.timer.timeout.connect(self.__move_ind)
def __init__(self, name, topic, addr, parent=None): super(__class__, self).__init__(parent) self.name = name self.topic = topic self.timer = QTimer() self.setGeometry(QRect(320, 180, 191, 81)) self.setDigitCount(10) self.setObjectName(topic) self.comm_handler = AsyncGraphCommHandler(addr.name, addr.comm) self.timer.timeout.connect(self.get_scalar) self.timer.start(1000)
def __init__(self, script, widget=None, close_on_finish=True, pause=0, is_cli=False): """ Initialise a runner. :param script: The script to run. :param widget: The widget to test. :param close_on_finish: If true close the widget after the script has finished. :param is_cli: If true the script is to be run from a command line tool. Exceptions are treated slightly differently in this case. """ app = get_application() self.script = script self.widget = widget self.close_on_finish = close_on_finish self.pause = pause self.is_cli = is_cli self.error = None self.script_iter = [None] self.pause_timer = QTimer(app) self.pause_timer.setSingleShot(True) self.script_timer = QTimer(app)
def on_mainwindow_visible(self): """Actions after the mainwindow in visible.""" # Show dialog with missing dependencies if not running_under_pytest(): # This avoids computing missing deps before the window is fully up timer_report_deps = QTimer(self) timer_report_deps.setInterval(2000) timer_report_deps.setSingleShot(True) timer_report_deps.timeout.connect( self.get_container().report_missing_dependencies) timer_report_deps.start()
def __init__(self, max_threads=10): """Spyder Worker Manager for Generic Workers.""" super(QObject, self).__init__() self._queue = deque() self._queue_workers = deque() self._threads = [] self._workers = [] self._timer = QTimer() self._timer_worker_delete = QTimer() self._running_threads = 0 self._max_threads = max_threads # Keeps references to old workers # Needed to avoud C++/python object errors self._bag_collector = deque() self._timer.setInterval(333) self._timer.timeout.connect(self._start) self._timer_worker_delete.setInterval(5000) self._timer_worker_delete.timeout.connect(self._clean_workers)
def __init__(self): super(QObject, self).__init__() self._conda_api = CondaAPI() self._queue = deque() self._threads = [] self._workers = [] self._timer = QTimer() self._chunk_size = 1024 self._timer.setInterval(1000) self._timer.timeout.connect(self._clean)
def __init__( self, dims, axis, fps=10, frame_range=None, playback_mode='loop', parent=None, ): super().__init__(parent) # could put some limits on fps here... though the handler in the QtDims # object above is capable of ignoring overly spammy requests. _mode = playback_mode.lower() _modes = {'loop', 'once', 'loop_back_and_forth'} if _mode not in _modes: raise ValueError( f'"{_mode}" not a recognized playback_mode: ({_modes})') self.dims = dims self.axis = axis self.dimsrange = self.dims.range[axis] if frame_range is not None: if frame_range[0] >= frame_range[1]: raise ValueError("frame_range[0] must be <= frame_range[1]") if frame_range[0] < self.dimsrange[0]: raise IndexError("frame_range[0] out of range") if frame_range[1] * self.dimsrange[2] >= self.dimsrange[1]: raise IndexError("frame_range[1] out of range") self.frame_range = frame_range self.playback_mode = _mode if self.frame_range is not None: self.min_point, self.max_point = self.frame_range else: self.min_point = 0 self.max_point = int( np.floor(self.dimsrange[1] - self.dimsrange[2])) self.max_point += 1 # range is inclusive # after dims.set_point is called, it will emit a dims.events.axis() # we use this to update this threads current frame (in case it # was some other event that updated the axis) self.dims.events.axis.connect(self._on_axis_changed) self.current = max(self.dims.point[axis], self.min_point) self.current = min(self.current, self.max_point) self.step = 1 if fps > 0 else -1 # negative fps plays in reverse self.timer = QTimer() self.timer.setInterval(1000 / abs(fps)) self.timer.timeout.connect(self.advance) self.timer.moveToThread(self) # this is necessary to avoid a warning in QtDims.stop() on del thread self.finished.connect(self.timer.deleteLater)
def main(): _ = QApplication(sys.argv) window = FeaturesGUI() window.show() timer = QTimer() timer.timeout.connect(window.update) timer.start(100) if (sys.flags.interactive != 1) or not hasattr(qtpy.QtCore, 'PYQT_VERSION'): QApplication.instance().exec_()
def mpl(): global i, graphics graphics = PMTimeSeriesMPLWidget(max_samples=100, recent_samples=20) graphics.show() i = 0 graphics.add_data('a', np.float) timer = QTimer() timer.start(50) timer.timeout.connect(time_out)
def __init__(self): """Create our windgets. """ super().__init__() layout = QVBoxLayout() # For our "uptime" timer. self.start_time = time.time() # Label for our progress bar. bar_label = QLabel("Draw Time:") layout.addWidget(bar_label) # Progress bar is not used for "progress", it's just a bar graph to show # the "draw time", the duration of the "UpdateRequest" event. bar = QProgressBar() bar.setRange(0, 100) bar.setValue(50) bar.setFormat("%vms") layout.addWidget(bar) self.bar = bar # We let the user set the "slow event" threshold. self.thresh_ms = self.THRESH_DEFAULT self.thresh_combo = QComboBox() self.thresh_combo.addItems(self.THRESH_OPTIONS) self.thresh_combo.activated[str].connect(self._change_thresh) self.thresh_combo.setCurrentText(str(self.thresh_ms)) combo_layout = QHBoxLayout() combo_layout.addWidget(QLabel("Show Events Slower Than:")) combo_layout.addWidget(self.thresh_combo) combo_layout.addWidget(QLabel("milliseconds")) combo_layout.addItem( QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) ) layout.addLayout(combo_layout) # We log slow events to this window. self.log = TextLog() layout.addWidget(self.log) # Uptime label. To indicate if the widget is getting updated. label = QLabel('') layout.addWidget(label) self.timer_label = label self.setLayout(layout) # Update us with a timer. self.timer = QTimer(self) self.timer.timeout.connect(self.update) self.timer.setInterval(self.UPDATE_MS) self.timer.start()
def __init__(self, delay=500): """ :param delay: Delay to wait before running the job. This delay applies to all requests and cannot be changed afterwards. """ self._timer = QTimer() self.delay = delay self._timer.timeout.connect(self._exec_requested_job) self._args = [] self._kwargs = {} self._job = lambda x: None
def _handle_mouse_moved(self, pos): """Show tooltip at mouse move.""" if not self._show_tooltip: return # create label tooltip, if needed if not hasattr(self, 'label_tooltip'): self.label_tooltip = QLabel(self, Qt.ToolTip) self.timer_tooltip = QTimer(self) self.timer_tooltip.timeout.connect(self.label_tooltip.hide) self.timer_tooltip.setInterval(1000) # find nearest curve point nearest = (self._curves[0], _np.inf, None, None) for idx, curve in enumerate(self._curves): if not curve.isVisible(): continue mappos = curve.mapFromScene(pos) posx, posy = mappos.x(), mappos.y() xData, yData = curve.curve.xData, curve.curve.yData if not xData.size: continue diffx = xData - posx idx = _np.argmin(_np.abs(diffx)) if diffx[idx] < 0.5: valx, valy = xData[idx], yData[idx] diffy = abs(valy - posy) if diffy < nearest[1]: nearest = (curve, diffy, valx, valy) # show tooltip curve, diffy, valx, valy = nearest ylimts = self.getViewBox().state['viewRange'][1] ydelta = ylimts[1] - ylimts[0] if diffy < 1e-2 * ydelta: txt = Time(timestamp=valx).get_iso8601() + '\n' txt += f'{curve.name()}: {valy:.3f}' font = QApplication.instance().font() font.setPointSize(font.pointSize() - 10) palette = QPalette() palette.setColor(QPalette.WindowText, curve.color) self.label_tooltip.setText(txt) self.label_tooltip.setFont(font) self.label_tooltip.setPalette(palette) self.label_tooltip.move(self.mapToGlobal(pos.toPoint())) self.label_tooltip.show() self.timer_tooltip.start() curve.scatter.setData(pos=[ (valx, valy), ], symbol='o', size=15, brush=mkBrush(curve.color)) curve.scatter.show()
def __init__(self, parent, history_filename, profile=False, initial_message=None, default_foreground_color=None, error_foreground_color=None, traceback_foreground_color=None, prompt_foreground_color=None, background_color=None): """ parent : specifies the parent widget """ ConsoleBaseWidget.__init__(self, parent) SaveHistoryMixin.__init__(self, history_filename) BrowseHistoryMixin.__init__(self) # Prompt position: tuple (line, index) self.current_prompt_pos = None self.new_input_line = True # History assert is_text_string(history_filename) self.history = self.load_history() # Session self.historylog_filename = CONF.get('main', 'historylog_filename', get_conf_path('history.log')) # Context menu self.menu = None self.setup_context_menu() # Simple profiling test self.profile = profile # Buffer to increase performance of write/flush operations self.__buffer = [] if initial_message: self.__buffer.append(initial_message) self.__timestamp = 0.0 self.__flushtimer = QTimer(self) self.__flushtimer.setSingleShot(True) self.__flushtimer.timeout.connect(self.flush) # Give focus to widget self.setFocus() # Cursor width self.setCursorWidth(CONF.get('main', 'cursor/width')) # Adjustments to completion_widget to use it here self.completion_widget.currentRowChanged.disconnect()
def __on_start_recording(self): ''' Starts the data collection timer. ''' if self.__timer is None: self.__timer = QTimer() self.__timer.timeout.connect(self.__collect_signals) logger.info( f"Starting data collection timer at {self.fps.value()} fps") self.__start_time = time.time() * 1000 self.__timer.start(1000.0 / self.fps.value()) self.resetButton.setEnabled(False)
def __init__(self, parent=None): super(_CondaAPI, self).__init__() self._parent = parent self._queue = deque() self._timer = QTimer() self._current_worker = None self._workers = [] self._timer.setInterval(1000) self._timer.timeout.connect(self._clean) self.set_root_prefix()
def compute_dependencies(self): """Compute dependencies.""" self.dependencies_thread.run = self._compute_dependencies self.dependencies_thread.finished.connect( self.report_missing_dependencies) # This avoids computing missing deps before the window is fully up dependencies_timer = QTimer(self) dependencies_timer.setInterval(10000) dependencies_timer.setSingleShot(True) dependencies_timer.timeout.connect(self.dependencies_thread.start) dependencies_timer.start()