# Path: pythics/settings.py
# _TRY_PYSIDE = True


import time
    import PySide2.QtCore as _QtCore
    import PySide2.QtGui as _QtGui
    import PySide2.QtWidgets as _QtWidgets
    import PySide2.QtPrintSupport as _QtPrintSupport
    import PyQt5.QtCore as _QtCore
    import PyQt5.QtGui as _QtGui
    import PyQt5.QtWidgets as _QtWidgets
    import PyQt5.QtPrintSupport as _QtPrintSupport
from pythics.settings import _TRY_PYSIDE
        QtWidgets.QDoubleSpinBox.__init__(self, parent, *args, **kwargs)
        self.format_str = format_str
        self.validator = QtGui.QDoubleValidator()

    def textFromValue(self, value):
        return self.format_str % value

    def validate(self, text, pos):
        return self.validator.validate(text, pos)

    def valueFromText(self, text):
        return float(text)

#
# floating point NumBox control with metric units
#
class MetricDoubleSpinBox(QtWidgets.QDoubleSpinBox):
    def __init__(self, parent=None, format_str='%g', base_unit='', metric_prefix='', *args, **kwargs):
        self.format_str = format_str
        self.base_unit = base_unit
        self.metric_prefix_value = self.lookup_metric_prefix_value(metric_prefix)
        suffix = ' ' + metric_prefix + base_unit
        self.set_unit(suffix)
        self.validator = QtGui.QDoubleValidator()
        QtWidgets.QDoubleSpinBox.__init__(self, parent, *args, **kwargs)
        self.setSuffix(suffix)
        # create the context menu
        self.context_menu = QtWidgets.QMenu()
        self.context_menu_action_group = QtWidgets.QActionGroup(self, exclusive=True)
        # add menu items

# Path: pythics/settings.py
# _TRY_PYSIDE = True


# Path: pythics/control_helpers.py
import time
    import PySide2.QtCore as _QtCore
    import PySide2.QtGui as _QtGui
    import PySide2.QtWidgets as _QtWidgets
    import PySide2.QtPrintSupport as _QtPrintSupport
    import PyQt5.QtCore as _QtCore
    import PyQt5.QtGui as _QtGui
    import PyQt5.QtWidgets as _QtWidgets
    import PyQt5.QtPrintSupport as _QtPrintSupport
from pythics.settings import _TRY_PYSIDE

        QtWidgets.QDoubleSpinBox.__init__(self, parent, *args, **kwargs)
        self.format_str = format_str
        self.validator = QtGui.QDoubleValidator()

    def textFromValue(self, value):
        return self.format_str % value

    def validate(self, text, pos):
        return self.validator.validate(text, pos)

    def valueFromText(self, text):
        return float(text)

#
# floating point NumBox control with metric units
#
class MetricDoubleSpinBox(QtWidgets.QDoubleSpinBox):
    def __init__(self, parent=None, format_str='%g', base_unit='', metric_prefix='', *args, **kwargs):
        self.format_str = format_str
        self.base_unit = base_unit
        self.metric_prefix_value = self.lookup_metric_prefix_value(metric_prefix)
        suffix = ' ' + metric_prefix + base_unit
        self.set_unit(suffix)
        self.validator = QtGui.QDoubleValidator()
        QtWidgets.QDoubleSpinBox.__init__(self, parent, *args, **kwargs)
        self.setSuffix(suffix)
        # create the context menu
        self.context_menu = QtWidgets.QMenu()
        self.context_menu_action_group = QtWidgets.QActionGroup(self, exclusive=True)
        # add menu items

        self.action_yotta = self.add_prefix_to_context_menu('Y (yotta)')