Example #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
Example #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
Example #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
Example #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
Example #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)))
Example #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)))
Example #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)))
Example #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)
Example #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)