Python 3 ?

Asked by Stefano

Is POD ready for python 3 ?

Thanks !

Question information

Language:
English Edit question
Status:
Solved
For:
Appy Edit question
Assignee:
No assignee Edit question
Solved by:
Gaëtan Delannay
Solved:
Last query:
Last reply:
Revision history for this message
Gaëtan Delannay (gaetan-delannay) said :
#1

Hi! I don't know. Never had the time to test it yet. Did you try ?? Feedback is welcome!

Revision history for this message
Stefano (mie-iscrizioni) said :
#2

haven't tried for now, but since my distro (Archlinux) is switching to python3 as default env., my situation is that seems reportlab isn't ready for python3, so now i'm watching around to find an alternative solution ;-)
Today i've found POD, but i haven't found info on its python3 support so asked here ;-)

Revision history for this message
Stefano (mie-iscrizioni) said :
#3
Revision history for this message
Best Gaëtan Delannay (gaetan-delannay) said :
#4

For sure. With POD, you create your document template with OpenOffice Writer (or another ODF-compliant word processor like KOffice). So everything you can do with OpenOffice, you can do it with POD. After this, you have to insert "dynamic" content by writing, in your document, special instructions written in Python, as "notes" or "track-changed" text. This is rather simple to use. You can consult the documentation at http://www.appyframework.org/pod.html

Revision history for this message
Stefano (mie-iscrizioni) said :
#5

great, thanks !
Hope it does work with python 3 ! ;-)

Revision history for this message
Luc Saffre (luc-saffre) said :
#6

Stefano, your last comment was that you *hope* that it works. Can you confirm whether it actually does work for you?

Revision history for this message
Nicholas Dietz (poleguy) said :
#7

I've been using appy pod on python 2.

I just started switching a bunch of automated test code over to python 3, and appy is the one piece that didn’t go smoothly. I had to move to the port by Stefan Klug:

https://pypi.python.org/pypi/appypod/0.9.6

It seems you are a one man shop, and I looked to see if you had published a roadmap to port this code to python 3. Since I didn’t see one, I’m reaching out to see what your plans are?

It seems like enough of the code works in the Klug port for me to hobble on, but I’d like to move back to using the official appy version to take advantage of future bug fixes, etc.

I had to merge in a bunch of stuff from a more recent appy version to get images to work correctly... it was a pain, but it's working now.

If you need some help porting to python 3, can I assist in any way?

Revision history for this message
Luc Saffre (luc-saffre) said :
#8

Hi Nicholas,

Gaetan is working on a Python 3 version of Appy:
https://forge.pallavi.be/projects/appy-python-3

And I believe that it is ready for a release
http://luc.lino-framework.org/blog/2017/1004.html#making-appy-ready-for-python-3

Revision history for this message
Ajit Abraham (ajitweb) said :
#9

Hi - Just wanted to check - if appy is python3 ready.
Regards

Revision history for this message
Luc Saffre (luc-saffre) said :
#10

If you need only app.pod (not the whole framework), then my partial redistribution of Gaetan's Python 3 version of Appy might be useful:
https://github.com/lino-framework/appypod

Revision history for this message
Ajit Abraham (ajitweb) said :
#11

Hello Luc,

Sorry for the beginner's question -

I did a 'pip install appypod'
I got version 0.9.6.
Is this the one? Or do I have to install it in some other way.

Thanks

Revision history for this message
Luc Saffre (luc-saffre) said :
#12

Ajit,

no, this is not released on PyPI, and I don't plan to release it on PyPI
because I hope that Gaetan will soon release the "real" version.

You can install my fork as follows:

$ pip install -e git+https://github.com/lino-framework/appypod.git#egg=appy

Though it might be more convenient to clone the repository and then
install it from there:

$ git clone https://github.com/lino-framework/appypod.git
$ pip install -e appypod

Note the -e switch which is optional but I recommend it
https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs

Luc

On 08/02/18 08:03, Ajit Abraham wrote:
> Question #130346 on Appy changed:
> https://answers.launchpad.net/appy/+question/130346
>
> Ajit Abraham posted a new comment:
> Hello Luc,
>
> Sorry for the beginner's question -
>
> I did a 'pip install appypod'
> I got version 0.9.6.
> Is this the one? Or do I have to install it in some other way.
>
> Thanks
>

Revision history for this message
Ajit Abraham (ajitweb) said :
#13

Hi Luc,

I created a new environment and installed the way you mentioned above.

At the renderer.run() i get the following permission error
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\PythonExercises\\projects\\drf\\result.odt.1518099472.407760\\unzip\\styles.xml'

I created another environment and installed the 0.9.6 of Stephan - and that renders without any problem.

I tried your fork in two more virtual environments (same windows pc) - but the results are same.

What can I be possibly doing wrong ?

Regards,

Ajit

Revision history for this message
Luc Saffre (luc-saffre) said :
#14

Ajit,
can you upload the a script and a template file which reproduces the error?

Luc

On 08/02/18 16:37, Ajit Abraham wrote:
> Question #130346 on Appy changed:
> https://answers.launchpad.net/appy/+question/130346
>
> Ajit Abraham posted a new comment:
> Hi Luc,
>
> I created a new environment and installed the way you mentioned above.
>
> At the renderer.run() i get the following permission error
> PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\PythonExercises\\projects\\drf\\result.odt.1518099472.407760\\unzip\\styles.xml'
>
> I created another environment and installed the 0.9.6 of Stephan - and
> that renders without any problem.
>
> I tried your fork in two more virtual environments (same windows pc) -
> but the results are same.
>
> What can I be possibly doing wrong ?
>
> Regards,
>
> Ajit
>

Revision history for this message
Ajit Abraham (ajitweb) said :
#15

Hi Luc,

https://we.tl/J1kZsOwKkf

I have uploaded the compressed project - including the environment. There you will also find my terminal's screenshot which shows the steps from the beginning till I get the errror message.

Thanks for taking the time to look into the problem.

Regards

Ajit

Revision history for this message
Luc Saffre (luc-saffre) said :
#16

Got it. Trying hard to find some time to look into it.

Luc

On 09/02/18 07:43, Ajit Abraham wrote:
> Question #130346 on Appy changed:
> https://answers.launchpad.net/appy/+question/130346
>
> Ajit Abraham posted a new comment:
> Hi Luc,
>
> https://we.tl/J1kZsOwKkf
>
> I have uploaded the compressed project - including the environment.
> There you will also find my terminal's screenshot which shows the steps
> from the beginning till I get the errror message.
>
> Thanks for taking the time to look into the problem.
>
> Regards
>
> Ajit
>

Revision history for this message
Luc Saffre (luc-saffre) said :
#17

Hi Ajit,

yes I can reproduce your problem. This seems to show that
`appy-python-3` was not ready for Python 3 when I forked it some months
ago. It is true that it does not have a real test suite.

And, oh my God, Gaetan continues developing in appy-python-3
<https://forge.pallavi.be/projects/appy-python-3> but refuses to add a
setup.py
<http://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/quickstart.html>
file so that normal people can use the package.  Furthermore I have no
idea whether he saw my fixes for the trivial errors I added to his code
after the fork.  No, this situation makes no sense! Gaetan, I want to
help you to make appy work under Python 3, I don't want to fork it for
good!  Gaetan, let's meet and collaborate!

Luc

On 09/02/18 07:43, Ajit Abraham wrote:
> Question #130346 on Appy changed:
> https://answers.launchpad.net/appy/+question/130346
>
> Ajit Abraham posted a new comment:
> Hi Luc,
>
> https://we.tl/J1kZsOwKkf
>
> I have uploaded the compressed project - including the environment.
> There you will also find my terminal's screenshot which shows the steps
> from the beginning till I get the errror message.
>
> Thanks for taking the time to look into the problem.
>
> Regards
>
> Ajit
>

Revision history for this message
Ajit Abraham (ajitweb) said :
#18

Hello Luc,

I totally understand when guys like you and Gaetan and others, are hard pressed for time when they spend time on community projects along with their day jobs and other commitments.

I am continuing with Stephan's fork. Here I ran into another issue when converting to pdf.
His code in appypod/appy/shared/utils.py was using the old popen3 command.
While Gaetan's utils.py was already using the new subprocess method.

So I overwrote Stephan's utils.py with Gaetan's utils.py.
As expected, I ran into errors as Gaetan's utils.py is still not Python3 ready.

By googling each error, I changed the utils.py and now the pdf (a simple three line document) is being generated.

These are the changes I made in Gaetan's utils.py to make it Python ready.

Line 33
from : except OSError, oe:
to : except OSError as oe:

Line 241
from : except UnicodeEncodeError, uer:
to : except UnicodeEncodeError as uer:

Line 536
from : typeLetters = {'b': bool, 'i': int, 'j': long, 'f': float, 's': str, 'u': unicode,'l': list, 'd': dict}
to: typeLetters = {'b': bool, 'i': int, 'j': int, 'f': float, 's': bytes, 'u': str, 'l': list, 'd': dict}

I will keep writing my outcome here as and when I create more complicated reports.

Regards
Ajit

Revision history for this message
Luc Saffre (luc-saffre) said :
#19

Thanks for reporting, Ajit. Yes, most problems are rather trivial to
fix. But there might be more difficult problems to come, and a fork
should be considered only if we cannot find an agreement with Gaetan. He
wants to work on pallavi.be (and not on GitHub), that's out of the
mainstream but acceptable for me. We just need to convince Gaetan that a
setup.py file is necessary. Let's hope that he will find some time soon
to work on a sustainable solution. For the moment I am still optimistic,
it's just a matter of time.

Luc

On 13/02/18 09:02, Ajit Abraham wrote:
> Question #130346 on Appy changed:
> https://answers.launchpad.net/appy/+question/130346
>
> Ajit Abraham posted a new comment:
> Hello Luc,
>
> I totally understand when guys like you and Gaetan and others, are hard
> pressed for time when they spend time on community projects along with
> their day jobs and other commitments.
>
> I am continuing with Stephan's fork. Here I ran into another issue when converting to pdf.
> His code in appypod/appy/shared/utils.py was using the old popen3 command.
> While Gaetan's utils.py was already using the new subprocess method.
>
> So I overwrote Stephan's utils.py with Gaetan's utils.py.
> As expected, I ran into errors as Gaetan's utils.py is still not Python3 ready.
>
> By googling each error, I changed the utils.py and now the pdf (a simple
> three line document) is being generated.
>
> These are the changes I made in Gaetan's utils.py to make it Python
> ready.
>
> Line 33
> from : except OSError, oe:
> to : except OSError as oe:
>
> Line 241
> from : except UnicodeEncodeError, uer:
> to : except UnicodeEncodeError as uer:
>
> Line 536
> from : typeLetters = {'b': bool, 'i': int, 'j': long, 'f': float, 's': str, 'u': unicode,'l': list, 'd': dict}
> to: typeLetters = {'b': bool, 'i': int, 'j': int, 'f': float, 's': bytes, 'u': str, 'l': list, 'd': dict}
>
> I will keep writing my outcome here as and when I create more
> complicated reports.
>
> Regards
> Ajit
>