Open CarlFK opened 4 years ago
There is a branch dabo3-4.1 that works with wxpython 4.1. There is also what I'm using which works with wxpython 4.0.7. That said, if all you need is to create PDF's then I don't know if either of these is a solution. Right now I can use the old reportlab 3.4.0 files to create PDF's using my code for 4.0.7. But the reportwriter does not work correctly. And I have not tested the reportwriter with the most recent code for wxpython 4.1.
Part of the issue is there has to be code updated for the reportwriter UI and then there is an issue with how the reportwriter is generating the XML. What little I can determine is the 'Y' value is not being generated correctly for XML and that will cause the latest version of reportlab to error.
Let me know how you would to solve this issue.
Johnf
On 8/31/20 9:27 AM, Carl Karsten wrote:
Anyone have some notes or tips for installing on Python 3?
dabodev.com says "Some initial steps at porting to Python 3 have been made" which points to the dabo3 branch.
Which currently doesn't work for me:
|$ git branch * dabo3 master $ python -c "from dabo.dReportWriter import dReportWriter " You need to install wxPython; minimum version = 4.0.0. |
this is new. for some value of new. I am just generating pdfs on a web server, so I don't need a gui.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP55Q5X3P5KOVARSZ2DLSDPFQDANCNFSM4QQWM4ZA.
I have rfxml files, I don't need to edit them, I just need render pdfs. So I don't need any of the UI parts working.
I am running this code on a web server, so I don't want to install or use wx. I'm guessing that requirement is a bit overreaching. I may try creating an empty wx module to appease the check and see if what I need working works.
Here is what I did to get the a pdf:
self.HomeDirectory = os.path.join(os.path.split(val)[:-1])[0]
https://github.com/dabodev/dabo/blob/master/dabo/lib/reportWriter.py#L3149
os.path.split(val)[:-1])[0] / [0/) bug #25
dabo/lib/reportWriter.py
-import dabo.dConstants as kons / +from dabo import dConstants as kons
dabo/biz/dBizobj.py
Image / Pill.Image
dabo/biz/dBizobj.py
repalce spaces with tab
dabo/lib/reportWriter.py
# del k, v, Decimal
dabo/db/__init__.py
buffer/bytes
dabo/db/__init__.py
translation.ugettext / translation.gettext
dabo/dLocalize.py
-from . import locale/ +import locale
dabo/__init__.py
uppercase / ascii_uppercase
dabo/lib/propertyHelperMixin.py
new.instancemethod / types.MethodType
2to3
Did all this to my master branch.
Ubuntu 18.04.5 LTS Python 3.6.9 (default, Jul 17 2020, 12:50:27)
python3-pil version (5.1.0-1ubuntu0.3). python3-reportlab version (3.4.0-3ubuntu0.1).
No wx, no designer.
Python 3.6.x is what I have on my computer too. However, I have noticed that 3.8.x has added issues. I haven't much time to look into the issues but will soon. Actually in the next few days if all works out.
The UI stuff works mostly (a few exceptions) and I wouldn't be concerned about using them.
Are you still running a hotel?
Johnf
On 8/31/20 2:12 PM, Carl Karsten wrote:
Here is what I did to get the a pdf:
self.HomeDirectory = os.path.join(os.path.split(val)[:-1])[0] https://github.com/dabodev/dabo/blob/master/dabo/lib/reportWriter.py#L3149 os.path.split(val)[:-1])[0] / [0/) bug #25 https://github.com/dabodev/dabo/issues/25
dabo/lib/reportWriter.py -import dabo.dConstants as kons / +from dabo import dConstants as kons
dabo/biz/dBizobj.py Image / Pill.Image
dabo/biz/dBizobj.py repalce spaces with tab
dabo/lib/reportWriter.py
del k, v, Decimal
dabo/db/init.py buffer/bytes
dabo/db/init.py translation.ugettext / translation.gettext
dabo/dLocalize.py -from . import locale/ +import locale
dabo/init.py uppercase / ascii_uppercase
dabo/lib/propertyHelperMixin.py new.instancemethod / types.MethodType
2to3
Did all this to my master branch.
Ubuntu 18.04.5 LTS Python 3.6.9 (default, Jul 17 2020, 12:50:27)
python3-pil version (5.1.0-1ubuntu0.3). python3-reportlab version (3.4.0-3ubuntu0.1).
No wx, no designer.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-684042849, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP5ZT2YMKMABRJZFGMI3SDQG33ANCNFSM4QQWM4ZA.
Hi Carl, I'm working on the Dabo3 branch and I wonder if you are using that branch with python 3.x? I ask because I do not see the some of the variables you describe in your earlier emails.
Johnf
On 8/31/20 11:43 PM, Carl Karsten wrote:
Report Designer would be nice. every 6 months or so I touch the rfxml
- I edit the xml and hit preview.
I ran a hotel? Hmm... that explain the gap in my resume ;)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-684467525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP55AXOCDMRDT4YMPXJLSDSJZPANCNFSM4QQWM4ZA.
Report Designer would be nice. every 6 months or so I touch the rfxml - I edit the xml and hit preview.
I ran a hotel? Hmm... that explain the gap in my resume ;)
Dabo3 branch didn't work for me. the blocker was:
$ python -c "from dabo.dReportWriter import dReportWriter "
You need to install wxPython; minimum version = 4.0.0.
I used master branch, which doesn't check for wx (I guess) and ran 2to3 over all the code.
Oh I see - I now have a better understanding of your unique requirements. Of course I am working on the dabo3 branch which I believe already had much of the 2to3 work done. If you have time you might want to check out the dabo3 branch. Most of the demo programs work (actually I'd like to know if you discover any issues with any of the demo apps). I have my personal programs working with dabo3, wxPython 4.1, python3.6+. But it would nice to have more working (although I don't use them) like ClassDesigner.py, ReportDesigner,py.
BTW the reference to the hotel was because I thought you moved to Switzerland and was running some sort of restaurant that had something to do with wine. I guess I am confusing you with someone else?????? Of course I thought the restaurant was in a hotel.
Thanks for the quick response, Johnf
On 9/10/20 3:33 PM, Carl Karsten wrote:
Report Designer would be nice. every 6 months or so I touch the rfxml
- I edit the xml and hit preview.
I ran a hotel? Hmm... that explain the gap in my resume ;)
Dabo3 branch didn't work for me. Pretty sure the blocker was: import dabo "error wx not installed"
I used master branch, which doesn't check for wx (I guess) and ran 2to3 over all the code.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-690767252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP53GEKX7TBA5VD3FK33SFFH5FANCNFSM4QQWM4ZA.
I just realized who I was confusing you with - Wermer F. Bruhin. He also worked on Dabo. So I don't make the mistake in future did you first get started with Fox and then moved python????? I am getting very old and have started my mental decline.
Johnf
On 9/10/20 3:53 PM, john wrote:
Oh I see - I now have a better understanding of your unique requirements. Of course I am working on the dabo3 branch which I believe already had much of the 2to3 work done. If you have time you might want to check out the dabo3 branch. Most of the demo programs work (actually I'd like to know if you discover any issues with any of the demo apps). I have my personal programs working with dabo3, wxPython 4.1, python3.6+. But it would nice to have more working (although I don't use them) like ClassDesigner.py, ReportDesigner,py.
BTW the reference to the hotel was because I thought you moved to Switzerland and was running some sort of restaurant that had something to do with wine. I guess I am confusing you with someone else?????? Of course I thought the restaurant was in a hotel.
Thanks for the quick response, Johnf
On 9/10/20 3:33 PM, Carl Karsten wrote:
Report Designer would be nice. every 6 months or so I touch the rfxml
- I edit the xml and hit preview.
I ran a hotel? Hmm... that explain the gap in my resume ;)
Dabo3 branch didn't work for me. Pretty sure the blocker was: import dabo "error wx not installed"
I used master branch, which doesn't check for wx (I guess) and ran 2to3 over all the code.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-690767252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP53GEKX7TBA5VD3FK33SFFH5FANCNFSM4QQWM4ZA.
I did come from Fox. Ed and Paul talked me into Python.
True story: I did a quick project (email white lister) and it was so easy I dismissed it as "bash with db access." two years later I took on another Python project and had to pay closer attention and wow was I put in my place. Fox out, Python in. never looked back and no regrets.
10 years ago I started making videos of talks at PyCon and other community ish conferences, which has come to a screeching halt as the equipment and sills needed for a live event don't really mean I am an expert at running an online event.
I have helped run 2 online events, helped a friend do a talk and gave a talk myself, so I may have more experience than anyone else now. top 10% anyway.
That said, I am currently working on light switch 2 point Oh. using CANbus to send messages from input devices to output devices. like a button and a light. the devices run Micro Python. it is working out to be pretty fun.
Very cool! I like the idea of using Micro Python but I don't any sort of project that it can be used.
Thanks for the refresher.
Johnf
On 9/10/20 4:29 PM, Carl Karsten wrote:
I did come from Fox. Ed and Paul talked me into Python. True story: I did a quick project (email white lister) and it was so easy I dismissed it as "bash with db access." two years later I took on another Python project and had to pay closer attention and wow was I put in my place. Fox out, Python in. never looked back and no regrets.
10 years ago I started making videos of talks at PyCon and other community ish conferences, which has come to a screeching halt as the equipment and sills needed for a live event don't really mean I am an expert at running an online event.
I have helped run 2 online events, helped a friend do a talk and gave a talk myself, so I may have more experience than anyone else now. top 10% anyway.
That said, I am currently working on light switch 2 point Oh. using CANbus to send messages from input devices to output devices. like a button and a light. the devices run Micro Python. it is working out to be pretty fun.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-690784574, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP57JABRS737XBRXCNITSFFONBANCNFSM4QQWM4ZA.
Can you remove the check for wx? then I can try out the report engine bits and let you know if anything there is 'interesting.'
I like this Switzerland restaurant idea. except now is a rough time to be running such things. A good friend turned the dining area of her restaurant into a frozen pizza shipping department and is paying the bills by shipping vegan pizza to 32 states.
I can't tell at the moment if that can be done. I have been just making sure everything opens and at least provides a foundation for each of the Dabo features. As you might be aware all the files, apps use many of the same files. So getting the apps(demo, ReportDesigner, ClassDesigner...) to open and at least to start working has provided insight on what is required changed in those foundation files.
What I can say is if you provide the way you use Dabo report writing I will take a look. I, of course, had to use 'wx' for the ReportDesigner to open - it is after all a visual tool. That said, it is also true that the under lying code may not require 'wx'.
Just tell me what is required. Johnf
On 9/13/20 1:57 PM, Carl Karsten wrote:
Can you remove the check for wx? then I can try out the report engine bits and let you know if anything there is 'interesting.'
I like this Switzerland restaurant idea. except now is a rough time to be running such things. A good friend turned the dining area of her restaurant into a frozen pizza shipping department and is paying the bills by shipping vegan pizza to 32 states.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-691724289, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP546XSXJOFO6BA6RYVLSFUW3XANCNFSM4QQWM4ZA.
I am sure the wx error is a preemptive measure to make it more obvious what the error is, assuming the code hits something that depends on wx.
Here is my non wx code:
rw = dReportWriter(OutputFile=buf, ReportFormFile=rfxmlfile, Cursor=ds)
pdf = buf.getvalue()
https://github.com/CarlFK/veyepar/blob/master/dj/main/views.py#L699-L703 https://github.com/CarlFK/veyepar/blob/master/dj/main/templates/recording_sheets.rfxml
that pdf gets sent to the browser: https://veyepar.nextdayvideo.com/main/recording_sheets.pdf/467/pyconau_2020_recording_sheets.pdf?day=5&location=curlyboi
I see it. from dabo import ui as dui
dui now contains wx.
wx then gets used
dui.yieldUI(_safe=True) - there are at least two calls from the following methods: _updateProgress _hideProgress
which calls
ui/init :
def yieldUI(_safe=False, *args, kwargs): """Yield to other apps/messages.""" if _safe: wx.YieldIfNeeded(*args, *kwargs) else: wx.Yield(args, kwargs)
I don't have an immediate replacement because I am not sure why it is there (something with a progress bar?). Maybe you can check how and why it is being called. Just off the top of my head I wonder if you can remove the two methods and the import and see if the dReportWriter will work.
I'm sure there is more involved but I have never used a progress bar with any reports or Dabo for that matter. And worse I really haven't used ReportDesigner in years and did not know there was a progress bar feature ( that assumes it is there to support a progress bar).
Johnf
On 9/13/20 7:25 PM, Carl Karsten wrote:
I am sure the wx error is a preemptive measure to make it more obvious what the error is, assuming the code hits something that depends on wx.
Here is my non wx code:
|rw = dReportWriter(OutputFile=buf, ReportFormFile=rfxmlfile, Cursor=ds) pdf = buf.getvalue() |
https://github.com/CarlFK/veyepar/blob/master/dj/main/views.py#L699-L703 https://github.com/CarlFK/veyepar/blob/master/dj/main/templates/recording_sheets.rfxml
that pdf gets sent to the browser: https://veyepar.nextdayvideo.com/main/recording_sheets.pdf/467/pyconau_2020_recording_sheets.pdf?day=5&location=curlyboi
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-691774637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP53RJP4XCPLR3RBOMX3SFV5LHANCNFSM4QQWM4ZA.
On branch dabo3 I made this one change:
# dReportWriter.py
...
from .settings import *
if implicitImports:
from dabo import ui as dui
and created:
settings_override.py
implicitImports = False
and now I have a pdf. yay.
I have no idea the implications of the "import settings..." but it should only effect dReportWriter, and at least the pdf creation part works. Lets hope it doesn't take out the progress bar
I wonder if others are using dReportWriter as you are?
If that worked for you then you might want to try moving the import to something like this:
If name == 'main': ... else: from dabo import ui as dui
I have not tested that but it should work and it eliminates the need for the setting file.
Johnf
On 9/13/20 10:59 PM, Carl Karsten wrote:
On branch dabo3 I made this one change:
|# dReportWriter.py ... from .settings import * if implicitImports: from dabo import ui as dui |
and created:
|settings_override.py implicitImports = False |
and now I have a pdf. yay.
I have no idea the implications of the "import settings..." but it should only effect dReportWriter, and at least the pdf creation part works. Lets hope it doesn't take out the progress bar
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-691830469, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP53ZPQIL6YHXRNUVATDSFWWMNANCNFSM4QQWM4ZA.
There are some other imports that also need to be skipped over, which are already under an if implicitImports:
from dabo import dEvents as dEvents
print("#1",__name__)
#1 dabo.dReportWriter
Which will also be the case if someone puts a "Print" button on a UI form.
https://docs.python.org/3/library/__main__.html:
'main' is the name of the scope in which top-level code executes. A module’s name is set equal to 'main' when read from standard input, a script, or from an interactive prompt.
I don't know - but if what you are doing is working then I guess we will have live with you needing to manually making the changes. At least for now.
Johnf
On 9/14/20 10:58 AM, Carl Karsten wrote:
There are some other imports that also need to be skipped over, which are already under an if implicitImports:
|from dabo import dEvents as dEvents print("#1",name) #1 dabo.dReportWriter |
Which will also be the case if someone puts a "Print" button on a UI form.
https://docs.python.org/3/library/__main__.html:
'*main*' is the name of the scope in which top-level code executes. A module’s *name* is set equal to '*main*' when read from standard input, a script, or from an interactive prompt.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-692217408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP576LLLCCPQ7EFDBRQTSFZKVHANCNFSM4QQWM4ZA.
The change to dReportWriter.py should work for everyone.
I think it is just fine that I have a settings_override.py - it is like my file of database connection parameters.
If that is the case can't you push the change? I will pull later when I start working on the project again (maybe tomorrow).
Johnf
On 9/14/20 11:40 AM, Carl Karsten wrote:
The change to dReportWriter.py should work for everyone.
I think it is just fine that I have a settings_override.py - it is like my file of database connection parameters.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dabodev/dabo/issues/35#issuecomment-692239247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYRP55ORHN3VDG3TQBTZLDSFZPQZANCNFSM4QQWM4ZA.
Anyone have some notes or tips for installing on Python 3?
dabodev.com says "Some initial steps at porting to Python 3 have been made" which points to the dabo3 branch.
Which currently doesn't work for me:
this is new. for some value of new. I am just generating pdfs on a web server, so I don't need a gui.