示例#1
0
 def _get_supported_types(self):
     if self.model.type == DeviceSettings.SCALE_DEVICE:
         supported_types = get_supported_scales()
     elif self.model.type == DeviceSettings.CHEQUE_PRINTER_DEVICE:
         supported_types = get_supported_printers_by_iface(IChequePrinter)
     else:
         raise TypeError("The selected device type isn't supported")
     return supported_types
示例#2
0
 def _get_supported_types(self):
     if self.model.type == DeviceSettings.SCALE_DEVICE:
         supported_types = get_supported_scales()
     elif self.model.type == DeviceSettings.CHEQUE_PRINTER_DEVICE:
         supported_types = get_supported_printers_by_iface(IChequePrinter)
     else:
         raise TypeError("The selected device type isn't supported")
     return supported_types
示例#3
0
 def _get_supported_types(self):
     if self.model.type == DeviceSettings.SCALE_DEVICE:
         supported_types = get_supported_scales()
     #elif self.model.type == DeviceSettings.CHEQUE_PRINTER_DEVICE:
     #    supported_types = get_supported_printers_by_iface(IChequePrinter)
     elif self.model.type == DeviceSettings.NON_FISCAL_PRINTER_DEVICE:
         supported_types = get_supported_printers_by_iface(INonFiscalPrinter,
                                                           include_virtual=is_developer_mode())
     else:
         raise TypeError("The selected device type isn't supported")
     return supported_types
示例#4
0
 def _get_supported_types(self):
     if self.model.type == DeviceSettings.SCALE_DEVICE:
         supported_types = get_supported_scales()
     #elif self.model.type == DeviceSettings.CHEQUE_PRINTER_DEVICE:
     #    supported_types = get_supported_printers_by_iface(IChequePrinter)
     elif self.model.type == DeviceSettings.NON_FISCAL_PRINTER_DEVICE:
         supported_types = get_supported_printers_by_iface(INonFiscalPrinter,
                                                           include_virtual=is_developer_mode())
     else:
         raise TypeError("The selected device type isn't supported")
     return supported_types
示例#5
0
    def _populate_printers(self):
        supported_ifaces = get_supported_printers_by_iface(ICouponPrinter).items()
        printers = []
        for brand, printer_classes in supported_ifaces:
            for printer_class in printer_classes:
                printer = _PrinterModel(brand, printer_class)
                printers.append((printer.get_description(), printer))

        if sysparam(self.store).DEMO_MODE:
            from stoqdrivers.printers.virtual.Simple import Simple
            printer = _PrinterModel('virtual', Simple)
            printers.append((printer.get_description(), printer))

        self.printer.prefill(locale_sorted(
            printers, key=operator.itemgetter(0)))
示例#6
0
    def _populate_printers(self):
        supported_ifaces = get_supported_printers_by_iface(ICouponPrinter).items()
        printers = []
        for brand, printer_classes in supported_ifaces:
            for printer_class in printer_classes:
                printer = _PrinterModel(brand, printer_class)
                printers.append((printer.get_description(), printer))

        # Allow to use virtual printer for both demo mode and developer mode
        # so it's easier for testers and developers to test ecf functionality
        if sysparam.get_bool('DEMO_MODE') or is_developer_mode():
            from stoqdrivers.printers.virtual.Simple import Simple
            printer = _PrinterModel('virtual', Simple)
            printers.append((printer.get_description(), printer))

        self.printer.prefill(locale_sorted(
            printers, key=operator.itemgetter(0)))
示例#7
0
    def _populate_printers(self):
        supported_ifaces = get_supported_printers_by_iface(ICouponPrinter).items()
        printers = []
        for brand, printer_classes in supported_ifaces:
            for printer_class in printer_classes:
                printer = _PrinterModel(brand, printer_class)
                printers.append((printer.get_description(), printer))

        # Allow to use virtual printer for both demo mode and developer mode
        # so it's easier for testers and developers to test ecf functionality
        if sysparam(self.store).DEMO_MODE or is_developer_mode():
            from stoqdrivers.printers.virtual.Simple import Simple
            printer = _PrinterModel('virtual', Simple)
            printers.append((printer.get_description(), printer))

        self.printer.prefill(locale_sorted(
            printers, key=operator.itemgetter(0)))
示例#8
0
def _check_printers(iface):
    printers_dict = get_supported_printers_by_iface(iface)
    for brand, drivers in printers_dict.items():
        _check_drivers(iface, brand, drivers)
示例#9
0
def _check_printers(iface):
    printers_dict = get_supported_printers_by_iface(iface)
    for brand, drivers in printers_dict.items():
        _check_drivers(iface, brand, drivers)