Porting to python3

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Lvaskz
Posts: 7
Joined: Thu Oct 06, 2016 6:38 pm

Re: Porting to python3

Postby Lvaskz » Wed Sep 19, 2018 11:14 am

Hello, I am using ubuntu 18.04, 64 bit and downloaded freecad conda to test it and I came across these issues
Menus are missing
Attachments
vlcsnap-2018-09-19-05h02m06s803.png
vlcsnap-2018-09-19-05h02m06s803.png (98.84 KiB) Viewed 868 times
vlcsnap-2018-09-19-05h01m52s532.png
vlcsnap-2018-09-19-05h01m52s532.png (91.93 KiB) Viewed 868 times
User avatar
looo
Posts: 3495
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Postby looo » Wed Sep 19, 2018 12:20 pm

Lvaskz wrote:
Wed Sep 19, 2018 11:14 am
Hello, I am using ubuntu 18.04, 64 bit and downloaded freecad conda to test it and I came across these issues
Menus are missing
Thanks for testing. Please have a look here for a workaround: https://github.com/FreeCAD/FreeCAD_Conda/issues/17

Should be fixed with the next qt update (qt5.12) which hopefully comes at the end of 2018.
User avatar
easyw-fc
Posts: 2928
Joined: Thu Jul 09, 2015 9:34 am

Re: Porting to python3

Postby easyw-fc » Fri Sep 28, 2018 9:22 am

A Draft.makeText issue for py3 migration:

Code: Select all

App.newDocument("Unnamed")
App.setActiveDocument("Unnamed")
App.ActiveDocument=App.getDocument("Unnamed")
Gui.ActiveDocument=Gui.getDocument("Unnamed")
import Draft
text = (["b'Test'"],point=FreeCAD.Vector(0.0,0.0,0.0))
Draft.autogroup(text)
Error code:

Code: Select all

Traceback (most recent call last):
  File "C:\FreeCAD-0.18-dev_PY3_QT5-x64\Mod\Draft\Draft.py", line 7297, in attach
    self.onChanged(vobj,"Justification")
  File "C:\FreeCAD-0.18-dev_PY3_QT5-x64\Mod\Draft\Draft.py", line 7330, in onChanged
    if hasattr(vobj,"Justification"):
<class 'AssertionError'>: The enum is empty
tested with:

Code: Select all

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14825 (Git)
Build type: Release
Branch: master
Hash: a0ff629747d5d73567075821852a8cdaadcf51c5
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
User avatar
Tandini
Posts: 30
Joined: Sat Jul 09, 2016 6:14 pm

Re: Porting to python3

Postby Tandini » Mon Oct 01, 2018 8:35 am

Hi,
I'm using Win10 Pro 64Bit version 1803 build 17134.285
On startpage/documents/Recent Files previews are not shown.
Same behaviour on computer at work as well as on computer at home (same OS builds)

FreeCAD 018. Conda preview issue.png
FreeCAD 018. Conda preview issue.png (140.6 KiB) Viewed 728 times
User avatar
looo
Posts: 3495
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Postby looo » Mon Oct 01, 2018 8:58 am

Tandini wrote:
Mon Oct 01, 2018 8:35 am
On startpage/documents/Recent Files previews are not shown.
This is a known issue. I think it's a problem of the qtwebkit of conda-forge. There is not much we can do about it right now. Maybe if someone has the time, create an issue for conda-forge qt-feedstock [1], but I think this feedstock needs to be reworked for qt5.12 anyway.

[1] https://github.com/conda-forge/qt-feedstock/issues
User avatar
Tandini
Posts: 30
Joined: Sat Jul 09, 2016 6:14 pm

Re: Porting to python3

Postby Tandini » Mon Oct 01, 2018 6:46 pm

chrisb wrote:
Mon Oct 01, 2018 4:12 pm
The dialog looks rather like a system dialog. Do you have a german environment on your computer?
Well, I'm German ... ;)
I installed and use 0.18 non-Conda and Conda parallel. So I just crosschecked: In non-Conda the dialog displays correct - completely translated in german ...

Sorry, I simply found a different behavior between the non-Conda and the Conda flavor ...
And I followed this advice:
Note on Python 3
Please test Python 3 (Conda) builds in your FreeCAD daily routine and report issues.
:? I apologize if it still isn't the right place - - - and please feel free to direct it to the right place.
User avatar
yorik
Site Admin
Posts: 12146
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Porting to python3

Postby yorik » Mon Oct 01, 2018 8:13 pm

Tandini wrote:
Mon Oct 01, 2018 8:35 am
On startpage/documents/Recent Files previews are not shown.
Out of curiosity, do other images and icons (in the "Help" tab) appear correctly?
User avatar
Tandini
Posts: 30
Joined: Sat Jul 09, 2016 6:14 pm

Re: Porting to python3

Postby Tandini » Mon Oct 01, 2018 10:05 pm

yorik wrote:
Mon Oct 01, 2018 8:13 pm
Out of curiosity, do other images and icons (in the "Help" tab) appear correctly?
No, they don't - but in non-Conda they appear corectly ...
User avatar
sgrogan
Posts: 6215
Joined: Wed Oct 22, 2014 5:02 pm

Re: Porting to python3

Postby sgrogan » Mon Oct 01, 2018 10:35 pm

Tandini wrote:
Mon Oct 01, 2018 10:05 pm
No, they don't - but in non-Conda they appear corectly ...
yorik wrote:
Mon Oct 01, 2018 8:13 pm
Out of curiosity, do other images and icons (in the "Help" tab) appear correctly?
With the AppImage the "Help" tab from Start WB works
start-help.png
start-help.png (40.78 KiB) Viewed 630 times
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14859 (Git) AppImage
Build type: Release
Branch: master
Hash: c3a8348861372b055c2446a09f0fc49a6cd7a2ef
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

Will Test on Win

EDIT: Doesn't work on win
start-help-win.PNG
start-help-win.PNG (17.61 KiB) Viewed 628 times
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14859 (Git)
Build type: Release
Branch: master
Hash: c3a8348861372b055c2446a09f0fc49a6cd7a2ef
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
"fight the good fight"
User avatar
yorik
Site Admin
Posts: 12146
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Porting to python3

Postby yorik » Tue Oct 02, 2018 1:25 pm

Hm indeed this is most likely a qt problem, but just in case there is a problem with icon paths, here is another thing to test: In the python console, type this:

Code: Select all

from StartPage import StartPage
StartPage.exportTestFile()
In your user's home directory, you should find a "startpage.html" file, that you can open in your web browser. Can someone check on windows if the icons appear?