yodebu / currentcostgui

Automatically exported from code.google.com/p/currentcostgui
GNU General Public License v3.0
0 stars 0 forks source link

REQ: Save XML line to a file. #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

It would be useful for me to have a local file data.xml which containe dthe
last xml line.

This would be overwritten each update.
I'm considering altering currentcostserialconn.py readUpdate.

Is this something you would consider adding?
Even better would be a http server offering the lastest xml on a
configurable port.

Original issue reported on code.google.com by matt.jo...@gmail.com on 16 Jul 2009 at 4:01

GoogleCodeExporter commented 8 years ago
    def readUpdate(self):
        if self.connection != None:
            try:
                self.lock.acquire()
                line = self.connection.readline()
                line = line.rstrip('\r\n')
                f=open("data.xml",'w')
                f.write(line)
                f.close()
                return line
            except serial.SerialException, err:
                self.disconnect()
                raise err
            except Exception, msg:
                self.disconnect()
                raise msg
            finally:
                self.lock.release()

Original comment by matt.jo...@gmail.com on 16 Jul 2009 at 4:25

GoogleCodeExporter commented 8 years ago
I would also be interested in both a overwritten file and http access.

Original comment by pvanleen...@gmail.com on 12 Mar 2010 at 2:42