當前位置: 首頁>>代碼示例>>Python>>正文


Python serialbase.SerialBase類代碼示例

本文整理匯總了Python中stoqdrivers.serialbase.SerialBase的典型用法代碼示例。如果您正苦於以下問題:Python SerialBase類的具體用法?Python SerialBase怎麽用?Python SerialBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SerialBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, port, consts=None):
        port.setParity(PARITY_EVEN)
        port.setWriteTimeout(3)

        SerialBase.__init__(self, port)
        self._consts = consts or FiscNetConstants
        self._command_id = 0
        self._reset()
開發者ID:Conectel,項目名稱:stoqdrivers,代碼行數:8,代碼來源:FiscNetECF.py

示例2: __init__

 def __init__(self, port, consts=None):
     self._consts = consts or MP25Constants
     port.setTimeout(2)
     port.setWriteTimeout(5)
     SerialBase.__init__(self, port)
     # XXX: Seems that Bematech doesn't contains any variable with the
     # coupon remainder value, so I need to manage it by myself.
     self.remainder_value = Decimal("0.00")
     self._reset()
開發者ID:esosaja,項目名稱:stoqdrivers,代碼行數:9,代碼來源:MP25.py

示例3: __init__

 def __init__(self, port, consts=None):       
     SerialBase.__init__(self, port)
     self._port.setTimeout(1.5)
     self._port.setWriteTimeout(5)
     self._port.setParity(serial.PARITY_EVEN)
     self._port.setXonXoff(0)
     self._port.setRtsCts(0)
     self.remainder_value = Decimal("0.0")       
     self._reset()
開發者ID:Cywaithaka,項目名稱:addons-cluster,代碼行數:9,代碼來源:SRP350.py

示例4: __init__

    def __init__(self, port, consts=None):
        SerialBase.__init__(self, port)

        # Make sure the printer is in ESC/BEMA mode
        self.write(GS + '\xF9\x20\x00')
        self._setup_charset()
        self.set_condensed()
        self.descentralize()
        self.unset_bold()
        self.unset_double_height()
開發者ID:stoq,項目名稱:stoqdrivers,代碼行數:10,代碼來源:MP2100TH.py

示例5: __init__

    def __init__(self, port, consts):
        SerialBase.__init__(self, port)
        BaseChequePrinter.__init__(self)
        self._consts = consts or EP375Constants
        self.coupon_discount = Decimal("0.0")
        self.coupon_surcharge = Decimal("0.0")
        self._command_id = self._item_counter = -1
        self.items_dict = {}
        self._is_coupon_open = False

        # The printer needs a little delay to shutdown/startup. Add this
        # number as a guard to make sure that the printer doesn't freeze
        # if we start up too fast.
        time.sleep(0.2)
開發者ID:Conectel,項目名稱:stoqdrivers,代碼行數:14,代碼來源:EP375.py

示例6: __init__

    def __init__(self, port, consts=None):
        port.parity = PARITY_EVEN
        port.writeTimeout = 3

        SerialBase.__init__(self, port)
        self._consts = consts or FiscNetConstants
        self._command_id = 0
        config = configparser.RawConfigParser()
        has_conf = config.read([os.path.expanduser('~/.stoq/stoqdrivers.conf')])
        if has_conf:
            try:
                self.CASH_SUPPLY = config.get('fiscnet', 'cash_supply')
                self.CASH_REMOVAL = config.get('fiscnet', 'cash_removal')
            except configparser.NoOptionError:
                log.info("Option not found, check stoqdrivers.conf")
        else:
            log.info("file: stoqdrivers.conf not found")
        self._reset()
開發者ID:stoq,項目名稱:stoqdrivers,代碼行數:18,代碼來源:FiscNetECF.py

示例7: __init__

 def __init__(self, port, consts=None):
     SerialBase.__init__(self, port)
     self._consts = consts or FBIIConstants
     self._command_id = FIRST_COMMAND_ID - 1  # 0x80
     self._reset()
開發者ID:Vauxoo,項目名稱:stoqdrivers,代碼行數:5,代碼來源:FBII.py

示例8: __init__

 def __init__(self, port, consts=None):
     SerialBase.__init__(self, port)
開發者ID:Cywaithaka,項目名稱:addons-cluster,代碼行數:2,代碼來源:base.py

示例9: __init__

 def __init__(self, port, consts=None):
     self._consts = consts or FS345Constants
     SerialBase.__init__(self, port)
     self._reset()
開發者ID:stoq,項目名稱:stoqdrivers,代碼行數:4,代碼來源:FS345.py

示例10: __init__

 def __init__(self, port, consts=None):
     SerialBase.__init__(self, port)
     self.set_condensed()
     self.descentralize()
     self.unset_bold()
     self.unset_double_height()
開發者ID:stoq,項目名稱:stoqdrivers,代碼行數:6,代碼來源:DR700.py

示例11: __init__

 def __init__(self, port, consts=None):
     SerialBase.__init__(self, port)
     BaseChequePrinter.__init__(self)
開發者ID:Conectel,項目名稱:stoqdrivers,代碼行數:3,代碼來源:DP20C.py

示例12: readline

 def readline(self):
     self._port.setDTR()
     return SerialBase.readline(self)
開發者ID:Conectel,項目名稱:stoqdrivers,代碼行數:3,代碼來源:EP375.py

示例13: writeline

 def writeline(self, data):
     while not self._port.getDSR():
         pass
     return SerialBase.writeline(self, data)
開發者ID:Conectel,項目名稱:stoqdrivers,代碼行數:4,代碼來源:EP375.py

示例14: __init__

 def __init__(self, device, consts=None):
     SerialBase.__init__(self, device)
     self._package = None
開發者ID:Conectel,項目名稱:stoqdrivers,代碼行數:3,代碼來源:PrixIII.py

示例15: __init__

 def __init__(self, port, consts=None):
     self._consts = consts or IFS9000IConstants
     SerialBase.__init__(self, port)
     self._customer_document = None
開發者ID:Cywaithaka,項目名稱:addons-cluster,代碼行數:4,代碼來源:IFS9000I.py


注:本文中的stoqdrivers.serialbase.SerialBase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。