MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / __init__

Method __init__

deeplabcut/gui/widgets.py:430–458  ·  view source on GitHub ↗
(self, config, parent=None)

Source from the content-addressed store, hash-verified

428
429class ConfigEditor(QtWidgets.QDialog):
430 def __init__(self, config, parent=None):
431 super().__init__(parent)
432 self.config = config
433 if config.endswith("config.yaml") and not config.endswith("pytorch_config.yaml"):
434 self.read_func = auxiliaryfunctions.read_config
435 self.write_func = auxiliaryfunctions.write_config
436 else:
437 self.read_func = auxiliaryfunctions.read_plainconfig
438 self.write_func = auxiliaryfunctions.write_plainconfig
439 self.cfg = self.read_func(config)
440 self.parent = parent
441 self.setWindowTitle("Configuration Editor")
442 if parent is not None:
443 self.setMinimumWidth(parent.screen_width // 2)
444 self.setMinimumHeight(parent.screen_height // 2)
445 self.viewer = DictViewer(self.cfg, config, self)
446
447 self.save_button = QtWidgets.QPushButton("Save", self)
448 self.save_button.setDefault(True)
449 self.save_button.clicked.connect(self.accept)
450 self.cancel_button = QtWidgets.QPushButton("Cancel", self)
451 self.cancel_button.clicked.connect(self.close)
452
453 vbox = QtWidgets.QVBoxLayout(self)
454 vbox.addWidget(self.viewer)
455 hbox = QtWidgets.QHBoxLayout()
456 hbox.addWidget(self.save_button)
457 hbox.addWidget(self.cancel_button)
458 vbox.addLayout(hbox)
459
460 def keyPressEvent(self, e):
461 if e.key() == QtCore.Qt.Key_Escape:

Callers

nothing calls this directly

Calls 3

DictViewerClass · 0.85
connectMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected