mò NógBc@s-defd„ƒYZdfd„ƒYZdS(tSerialExceptioncBstZRS(N(t__name__t __module__(((tS/usr2/students/cs526/public_html/tinyos/tools/src/mspgcc-pybsl/serial/serialutil.pyRstFileLikecBs\tZdZd„Zd„Zedd„Zedd„Zed„Zd„Z d„Z RS( sêAn abstract file like class. This class implements readline and readlines based on read and writelines based on write. This class is used to provide the above functions for to Serial port objects. Note that when the serial port was opened with _NO_ timeout that readline blocks until it sees a newline (or the specified size is reached) and that readlines would never return and therefore refuses to work (it raises an exception in this case)! cCs t‚dS(N(tNotImplementedError(tselftsize((RtreadscCs t‚dS(N(R(Rts((Rtwritess cCsnd}xa|idƒ}|oE||7}||joPn|dj ot|ƒ|joPqeq Pq W|S(sjread a line which is terminated with end-of-line (eol) character (' ' by default) or until timeouttiN(tlineRRtcteolRtNonetlen(RRRR R ((Rtreadlines    cCsp|idjo td‚ng}xF|id|ƒ}|o'|i|ƒ|d|joPqgq&Pq&W|S(s?read a list of lines, until timeout sizehint is ignoreds8Serial port MUST have enabled timeout for this function!iRiÿÿÿÿN( RttimeoutRt ValueErrortlinesRRR tappend(RtsizehintRRR ((Rt readlines&s   cCs |iƒS(s,just call readlines - here for compatibilityN(RR(RR((Rt xreadlines6scCs"x|D]}|i|ƒqWdS(N(tsequenceR RR (RRR ((Rt writelines:scCsdS(sflush of file like objectsN((R((Rtflush>s( RRt__doc__RR RRRRRR(((RRs     N(t ExceptionRR(RR((Rt?s