If you split one file, I would basically just copy over the copyright info of the former file.. Or add yours instead, I have no problem with that really
Basically, to give you a general idea of what I had in mind:
Draft.py contains two things:
- generic functions to be used by python coders, basically to do from python everything you can do via the UI (move, rotate, create line,...)
- definitions of the Draft objects (Line, rectangle...) and their view providers
DraftTools contains the different FreeCAD commands (Line, Rectangle...), that is, basically the "actions" behind the UI buttons. There actions sometimes create objects (Line, Circle..), sometimes not (Move, Rotate..)
DraftGui contains all stuff regarding the UI and the different task panels. It's a mess I'm afraid
and almost impossible to split. Probably some parts of it will need to be recoded at some point
There are already other parts that have been split out, like DraftSnap (all the snapping system), DraftTrackers (the 3D screen "widgets" used by draft), DraftVecUtils,DraftGeomUtils,...
I think I would start, like vocx suggests, by splitting DraftTools, by different types of operation: Line, Wire, Rectangle... Then, probably the corresponding function (makeLine) and objects (Line) can also be moved from Draft.py. together. So everything regarding lines is together, and so on... That seems to me an easy way for new people to dig into the code. But if you have better ideas, go ahead!
A couple of things to be aware:
- Everything is always split between GUI and non-GUI use. When using FreeCAD from the command line or as a python module, the FreeCADGui module is not available, neither everything that depends on the UI (view providers, DraftGui, PySide.QtGui,...). You'll see some if FreeCAD.GuiUp
here and there that load or don't load stuff appropriately. Basically, the rule is that we should always be able to import Draft
in console mode.
- For Draft objects, like all python-defined objects in FreeCAD, the actual code is not stored in a FreeCAD file. Only the module name, class name, and the different properties. When loading a file, a Draft object is reconstructed by creating an object from the module name and class name, and populating its properties. So when loading a file containing a Draft._Line, FreeCAD will try to load a Draft module and create an instance of a _Line class. If we change these things from location or rename them, we must take care of leaving aliases in place.
I haven't really planned to work on any this yet (actually writing the plan above is a good step
). I think I would start with that, as it will make further work much easier... But it's rather boring work, you might prefer to wet the appetite with something more fun