Another patch for Firedrop

0 views
Skip to first unread message

Adalbert Prokop

unread,
Oct 15, 2006, 2:28:34 PM10/15/06
to fire...@googlegroups.com
Hi everybody

Did you realise, that the menu option Styles->Weird stuff->rot13 does not
work? It simply produces an error message about wrong number of
parameters. I've created a patch (attached to this mail) which corrects
this. Which leads to another minor problem.

This rot13 plugin is buggy. It does not work with UTF-8 strings. All I get
is an error message if there are non ASCII characters involved. The
function calls descend to a wx-library, which is an shared-object,
compiled natively. It seems this wx-library calls pythons encoding
functions. It would help to pass the option errors="ignore" to those
encoding functions to prevent the error and ignore non ASCII characters.
But how can I do it *without* changing the wx-Code?

Bye
Adalbert
--
Bad cafeteria food landed all the sysadmins in the hospital.

firedrop2-0.2.2-rot13.patch.txt

Michael Foord

unread,
Oct 15, 2006, 3:32:06 PM10/15/06
to fire...@googlegroups.com
Well.... a better option might be to remove ROT13. It's not exactly useful.

In order to modify text in non-trivial ways, you *have* to know the
encoding.

Other than that, it shouldn't be very difficult to provide an
alternative implementation of ROT13

Fuzzyman
http://www.voidspace.org.uk

> Bye
> Adalbert
>
> ------------------------------------------------------------------------
>
> --- firedrop2/textmanipulator.py.orig 2006-10-15 17:03:43.000000000 +0200
> +++ firedrop2/textmanipulator.py 2006-10-15 17:08:10.000000000 +0200
> @@ -242,7 +242,7 @@
> return "\n%s\n| %s |\n%s" % (frameline,"code block here",frameline,)
>
>
> - def rot13(self, text):
> + def rot13(self, text, markup):
> return text.encode("rot13")
>
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.408 / Virus Database: 268.13.4/476 - Release Date: 14/10/2006
>

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.4/476 - Release Date: 14/10/2006

Adalbert Prokop

unread,
Oct 15, 2006, 3:45:59 PM10/15/06
to fire...@googlegroups.com
Michael Foord schrieb am Sonntag, 15. Oktober 2006 21:32:

> > This rot13 plugin is buggy. It does not work with UTF-8 strings. All
> > I get is an error message if there are non ASCII characters involved.
> > The function calls descend to a wx-library, which is an
> > shared-object, compiled natively. It seems this wx-library calls
> > pythons encoding functions. It would help to pass the option
> > errors="ignore" to those encoding functions to prevent the error and
> > ignore non ASCII characters. But how can I do it *without* changing
> > the wx-Code?

> Well.... a better option might be to remove ROT13. It's not exactly
> useful.

*lol* That truly might be the better option. I do not claim ROT13 encoding
to be useful. I hoped there is a way to solve this problem. In this vein
I also might have learned more about Python. ;-)

Bye,
Adalbert
--
Without ice cream life and fame are meaningless.

Reply all
Reply to author
Forward
0 new messages