brendonh / pyth

Python text markup and conversion
MIT License
89 stars 79 forks source link

Pyth py3: partial Python 3 port #33

Closed prechelt closed 7 years ago

prechelt commented 9 years ago

Hi Brendon, I need a good RTF reader for my application, which is in Python 3. I chose pyth and attempted to migrate it using 'modernize' and 'six'. It was far from easy (because the bytes-vs-plainstring-vs-unicode issues are non-obvious for code that is handling RTF -- in particular as I know neither much of RTF nor the design of that code), but I believe have I have now gotten rtf15/reader and xhtml/writer to work.

I have extended the tests to complete end-to-end tests using the above pair of converters and they work correctly on Python 3.4.3 (on Windows) and Python 2.7.8 (on Cygwin). The other converters I have neither debugged nor tested.

Unless verifying that the other parts still work (at least on Python 2) is too difficult for you, I would be most grateful if you could turn this into a new release. I will be using it in my application in any case, whether by loading it from PyPI (nice) or not (less nice).

I updated README a bit (could use a little more updating, I think) and have left bits of documentation in various other places as well (the py3migration directory and several new README files in particular).

Please check it out -- and thank you for creating pyth in the first place!

Lutz

brendonh commented 9 years ago

Hi Lutz! Thanks a bunch for working on this -- it's been requested a few times lately. The changes look generally good to me, and less scary than I'd have expected. Please take a look at the minor things I've commented above, and meanwhile I'll try to find time in the next few days to bang on it in Py2.

I've been meaning to make a new release for a while, perhaps even a 1.0, but I should do some work on the docs and other small things first. I have some vacation time from next week which might work for that.

prechelt commented 9 years ago

I have added one more commit, for supporting 'Symbol' font. See the commit message for details. And again I have forgotten one cleanup: removing #for (i, c) in enumerate(input): Sigh...

prechelt commented 9 years ago

Yet another commit, containing much better tests. See the commit message for the content and execute tests/test_readrtf15.py to see for yourself. (List handling needs improvement.)

gilsondev commented 8 years ago

So, this migrations its ok?

EpocDotFr commented 7 years ago

I would love having news about this project.

Would this PR be merged?

prechelt commented 7 years ago

I'll open a new pull request to replace this one in a minute (because I have moved that development from a separate branch to the master branch in my fork). The new one will contain a consolidated version that I am going to consider to be pyth 0.7.