[Fwd: [Tuxpaint-cvs] tuxpaint-stamps/stamps/animals/mammals/deer wapiti.txt, 1.1, 1.2]

View: New views
2 Messages — Rating Filter:   Alert me  

[Fwd: [Tuxpaint-cvs] tuxpaint-stamps/stamps/animals/mammals/deer wapiti.txt, 1.1, 1.2]

by Pere Pujal i Carabantes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It seems we are loosing ending characters when there is no newline at
the end of a new .txt file.

This patch fixes this:
diff txt2pot.py.back txt2pot.py
28c28,30
<           line = txtFile.readline()[:-1]
---
>           line = txtFile.readline()
>           if line[-1:] == "\n" :
>               line = line[:-1]


Not tested with files coming from windows.

-------- Missatge reenviat --------
[...snip...]

> Index: wapiti.txt
> ===================================================================
> RCS file: /cvsroot/tuxpaint/tuxpaint-stamps/stamps/animals/mammals/deer/wapiti.txt,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -d -r1.1 -r1.2
> --- wapiti.txt 20 May 2008 21:54:09 -0000 1.1
> +++ wapiti.txt 21 May 2008 15:04:27 -0000 1.2
> @@ -1 +1 @@
> -A wapiti.
> \ No newline at end of file
> +A wapiti
>



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tuxpaint-stamps mailing list
Tuxpaint-stamps@...
https://lists.sourceforge.net/lists/listinfo/tuxpaint-stamps

Re: [Fwd: [Tuxpaint-cvs] tuxpaint-stamps/stamps/animals/mammals/deer wapiti.txt, 1.1, 1.2]

by Bill Kendrick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, May 26, 2008 at 07:17:09PM +0200, Pere Pujal i Carabantes wrote:

> It seems we are loosing ending characters when there is no newline at
> the end of a new .txt file.
>
> This patch fixes this:
> diff txt2pot.py.back txt2pot.py
> 28c28,30
> <           line = txtFile.readline()[:-1]
> ---
> >           line = txtFile.readline()
> >           if line[-1:] == "\n" :
> >               line = line[:-1]

Applied.

-bill!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tuxpaint-stamps mailing list
Tuxpaint-stamps@...
https://lists.sourceforge.net/lists/listinfo/tuxpaint-stamps