New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: split objects and functions from Draft.py #3388
Conversation
5a19b71
to
498d410
Compare
@vocx-fc any hints why it fails with py2? I do not spot any error related to Draft in the build log... |
Oh, Bernd has been doing some edits to FEM, and now it's causing errors with Python 2. So, yeah, it's not related to Draft. |
ok, so let's go on with cherrypicking old commits to make the pr ready to merge! |
b1e32c8
to
2ed6386
Compare
Here we are. This was the easy part. We can now move to another PR to tackle the functions before going back to arrays objects. |
@vocx-fc @yorikvanhavre there is one thing that I do not like much: all the make functions are renamed |
Awesome. As I can see, you aren't using my commit any more, right? Now it's all authored by yourself. Yes, I think this is the way to go. We don't have to move all objects in a single super huge pull request, we can move a few at a time, so it's easier to review and spot problems. |
Well I thought It was better to start from scratch from current upstream master. |
I'm not sure what the problem is. The But you don't need to duplicate it. Python is flexible, so you can rename a function to any name we want. This can be done at import time. from draftmake.make_circle import make_circle
from draftmake.make_circle import make_circle as makeCircle The name of the Proxy class is the important thing and must be preserved, but the make function can be anything. |
I like that style of import! still I have this doubt about being PEP8 compliant for those functions that are at the moment spread around the whole FreeCAD modules, macros etc... (objects are not, makefunctions are). PR: #3394 follows this one! |
Well, my grand idea is that we should make the entire FreeCAD PEP8 compliant, but I'm only a single person, so I can only change things little by little. For example, FEM is pretty much PEP8 compliant because Bernd has kept it that way. On the other hand, we may have to talk to the Path guys because they don't seem to be compliant either. Making sure the big Python workbenches follow PEP8 would be great but it is hard work. |
@vocx-fc ok, at the moment it's like this, so let's keep it PEP8! |
Sorry I merged one other PR in the wrong order... Would you mind having a look at the conflict here @carlopav ? |
The conflict stems from my modification of There should be an automated way to specify dependencies between pull requests by the contributors... |
Add DraftObject and ViewProviderDraft to serve as the parent classes of all Draft objects and all Draft view providers. Inside `Draft.py` we need to import `_DraftObject` from `draftobjects.base`; and `_ViewProviderDraft`, `_ViewProviderDraftAlt`, and `_ViewProviderDraftPart` from `draftviewproviders.view_base`. . . . .
Line Polyline BezCurve BSpline . . .
273aa24
to
dd3b820
Compare
@kryptokommunist Do not worry,the array classes are not splitted yet, so no problem :) |
@yorikvanhavre rebased and ready for merging :) |
Okay, thanks!! Waiting for the CI test to finish and I merge |
@yorikvanhavre good! mind that the test fail with py2 as every other PR in the last week :) |
uuuuuuuu..... scaring :) |
Add DraftObject and ViewProviderDraft to serve as
the parent classes of all Draft objects
and all Draft view providers.
Inside
Draft.py
we need to import_DraftObject
fromdraftobjects.base
;and
_ViewProviderDraft
,_ViewProviderDraftAlt
,and
_ViewProviderDraftPart
fromdraftviewproviders.view_base
.