Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# limitations under the License.
#
# ----------------------------------------------------------------------------
# Standard library imports
# Related third party imports
from PyQt5.QtWidgets import QComboBox
# Local application/library specific imports
from harvesters._private.core.observer import Observer
from harvesters_gui._private.frontend.pyqt5.helper import get_system_font
class ComboBoxDeviceList(QComboBox, Observer):
def __init__(self, parent=None):
super().__init__(parent)
self.setFont(get_system_font())
def update(self):
if self.parent().parent().harvester_core.has_revised_device_info_list:
self.clear()
separator = '::'
for d in self.parent().parent().harvester_core.device_info_list:
name = d.vendor
name += separator
name += d.model
try:
_ = d.serial_number
except: # We know it's too broad:
# ----------------------------------------------------------------------------
# Standard library imports
# Related third party imports
from PyQt5.QtWidgets import QComboBox
from genicam2.gentl import NotImplementedException, NotAvailableException, \
InvalidParameterException
# Local application/library specific imports
from harvesters._private.frontend.pyqt5.helper import get_system_font
from harvesters._private.core.observer import Observer
class ComboBox(QComboBox, Observer):
def __init__(self, parent=None):
super().__init__(parent)
self.setFont(get_system_font())
def update(self):
if self.parent().parent().harvester_core.has_revised_device_info_list:
self.clear()
separator = '::'
for d in self.parent().parent().harvester_core.device_info_list:
name = d.parent.parent.vendor # i.e., system.vendor
name += separator
name += d.vendor
name += separator
name += d.model
if d.serial_number:
name += separator
#
# ----------------------------------------------------------------------------
# Standard library imports
# Related third party imports
from PyQt5.QtWidgets import QComboBox
from genicam2.gentl import NotImplementedException, NotAvailableException
# Local application/library specific imports
from harvesters._private.frontend.pyqt5.helper import get_system_font
from harvesters._private.core.observer import Observer
class ComboBox(QComboBox, Observer):
def __init__(self, parent=None):
super().__init__(parent)
self.setFont(get_system_font())
def update(self):
if self.parent().parent().harvester_core.has_revised_device_info_list:
self.clear()
separator = '::'
for d in self.parent().parent().harvester_core.device_info_list:
name = d.parent.parent.vendor # i.e., system.vendor
name += separator
name += d.vendor
name += separator
name += d.model
if d.serial_number:
name += separator