def __init__(self, deviceFile=None, speed=9600, host=None, port=None, model="615", dummy=False,
              connectOnEveryCommand=False):
     try:
         if dummy:
             self.driver = DummyDriver()
         elif host:
             if connectOnEveryCommand:
                 self.driver = epsonFiscalDriver.EpsonFiscalDriverProxy(host, port,
                     connectOnEveryCommand=True)
             else:
                 self.driver = epsonFiscalDriver.EpsonFiscalDriverProxy(host, port)
         else:
             deviceFile = deviceFile or 0
             self.driver = epsonFiscalDriver.HasarFiscalDriver(deviceFile, speed)
     except Exception, e:
         raise FiscalPrinterError("Imposible establecer comunicación.", e)
 def __init__(self, deviceFile=None, speed=9600, host=None, port=None, dummy=False, model=None):
     try:
         if dummy:
             self.driver = DummyDriver()
         elif host:
             self.driver = epsonFiscalDriver.EpsonFiscalDriverProxy(host, port)
         else:
             deviceFile = deviceFile or 0
             self.driver = epsonFiscalDriver.EpsonFiscalDriver(deviceFile, speed)
         #self.driver = FileDriver( "/home/gnarvaja/Desktop/fiscal.txt" )
     except Exception, e:
         raise FiscalPrinterError("Imposible establecer comunicación.", e)