def sleep(self): """ Wait for the splash screen to be drawn for at least 'mtime' seconds. """ now = time() if now < self.mtime: for _ in rangeF(start=0, stop=self.mtime - now, step=0.01): QtWidgets.QApplication.processEvents() sleep(0.01)
def __init__(self, spec, session): """ Initialize the plugin. :type spec: PluginSpec :type session: session """ super().__init__(spec, session) self.afwset = set() self.level = DiagramView.ZoomDefault self.levels = [x for x in rangeF(DiagramView.ZoomMin, DiagramView.ZoomMax + DiagramView.ZoomStep, DiagramView.ZoomStep)] self.view = None
def __init__(self, spec, session): """ Initialize the plugin. :type spec: PluginSpec :type session: session """ super().__init__(spec, session) self.afwset = set() self.level = DiagramView.ZoomDefault self.levels = [ x for x in rangeF(DiagramView.ZoomMin, DiagramView.ZoomMax + DiagramView.ZoomStep, DiagramView.ZoomStep) ] self.view = None
def test_generator(self): self.assertEqual([0.0, 1.0, 2.0, 3.0], list(rangeF(0.0, 4.0, 1.0))) self.assertEqual([0.0, 0.2, 0.4, 0.6, 0.8], list(rangeF(0.0, 1.0, 0.2))) self.assertEqual([0.0000, 0.0001, 0.0002, 0.0003, 0.0004], list(rangeF(0.0000, 0.0005, 0.0001)))
def test_generator(): assert [0.0, 1.0, 2.0, 3.0] == list(rangeF(0.0, 4.0, 1.0)) assert [0.0, 0.2, 0.4, 0.6, 0.8] == list(rangeF(0.0, 1.0, 0.2)) assert [0.0000, 0.0001, 0.0002, 0.0003, 0.0004] == list(rangeF(0.0000, 0.0005, 0.0001))