Hi Matteo,
I did not mean your code and I was not talking about code quality, I am
sorry if you took it personally.
I think the project has grown over time and it is not a bad idea to do some
restructuring, now it takes to much time to understand the code.
Maybe we can arrange the code into modules, for instance a module "display"
or "render" in which all the code for rendering the image is.
I did not think about such a structure but in that way you know where to
look for the code.
If we first do this rearrange of code, splitting the files and put them
into separate modules.
After that we can modify some code that is hard to understand.
For me the handiest way is to change the code when I touch it.
What I mean is when I need to change the code for new functionality or else
that is the time to take a good look at the current state of the code and
if there is a need to simplify is (at class or member/function level), not
to do to many changes at once.
Maybe we can think about the structure of the code and both post a proposal
in the next few days that we can discuss.
And about the toolkit, you are right, pygtk is a good choice and is a waste
of time to throw away the code.
Regards,
Gertwin
On Oct 31, 2009 7:28am, "eu...@li..." <eu...@li...> wrote:
> Hi Getwin,
> This is the first time that I discuss of pythoncad code, so for me It's
> ok to review some code..I take me lot of time to understand how It
> works...
> I agree with you that my code is not so good.... but sometimes I work 1/2
> ha day so It's easy to forget what you have done few day before ...
> We can make a list of file & Functions classes that need improvements and
> work together to rich the objective.
> One of the files that need to be splitted is the gtkentitys.py, tool.py,
> gtkmenus.py that provide the command functionality.
> Here we can make a deep split one file for each command.
> One exsample culd be:
> segmendCommand.py in witch we can put all comand for the segment..
> like tools menu callback.
> Another File that need to be restructured is the gykImage.py it's not
> easy to understand ....and in there i have made my first modification of
> pythoncad for zooming and panning :-)
> So if you agree with this kind of split I can start splitting the file
> gtkmenu,gtkentitys,tools...
> >> I don't know what is the best choice.
> Me too. We can decide it later, gtk is cross platform and it wide (Es
> Gimp) used.
> So it's not a so bad choice ...:-)
> If you have any suggestions please tell me so we can discuss it and make
> the best choice for pythoncad future.
> Regards,
> Matteo
> > Hi Matteo,
> >
> > I don't think it is only one source file wich I want to split.
> > Most of the source files are huge (even more than 100kb) and it cost a
> > large amout of time to find my way in it.
> > Also the use of local variables within member functions in wich member
> > variables are copied makes it very hard to understand the code.
> > No offence but I think some parts of the code need a cleanup to make
> > it better mainainable.
> >
> > For the user interface, switching to an other toolkit of cource means
> > a complete rewrite of the code.
> > But writing an interface separate for each platform is not something I
> > want to do.
> > I think the user interface should be as native as possible to the
> > user, so tkinter is not a very good choice.
> > Gtk is native on linux/gnome but not on linux/kde, windows and os-x.
> >
> > If you want to rewrite the userinterface we must make a choice from:
> > - gtk/pygtk
> > - Qt/pyQt
> > - swing with jython
> > - tkinter
> > - ??
> >
> > I don't know what is the best choice.
> > swing with jython look great on os-x but not so on linux.
> > Maybe Qt is the most "near native" of the toolkits.
> >
> > Regards,
> > Gertwin
> >
> >
> >
> >
> > 2009/10/30 eu...@li... eu...@li...>:
> > > Hi Gertwin,
> > > Nice to see you ..
> > >
> > >>Question is can I break up some of the source files in several smaller
> > >>source files?
> > > Of course yes... but we need to decide witch file you what to split.
> > > The best think is that we make the split in R37 and the you create a
> r37_Osx branch.. so the future marge will be less drastic.
> > > Do you think that we can delete the cairo folder from
> pythoncadinstallation folder ?
> > >
> > > We can sumarize the work in this step.
> > >
> > > * decide the file to be splitted
> > > * make the split
> > > * test that the R37 work after the split.
> > > * create the new branch
> > >
> > > It's realistic thinking to migrate to tkinter interface ?
> > > What do you think ?
> > > Dose tkinter give you less problem than gtk in osx enviroment ?
> > >
> > > Regards,
> > > Matteo
> > >
> > >
> > > ---------- Initial Header -----------
> > >
> > > From : pyt...@li...
> > > To : pyt...@li...
> > > Cc :
> > > Date : Thu, 29 Oct 2009 21:28:51 +0000
> > > Subject : Pythoncad-developer post from ger...@gm...
> requires approval
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >> As list administrator, your authorization is requested for the
> > >> following mailing list posting:
> > >>
> > >> List: Pyt...@li...
> > >> From: ger...@gm...
> > >> Subject: OS X version of pythoncad
> > >> Reason: Post by non-member to a members-only list
> > >>
> > >> At your convenience, visit:
> > >>
> > >> https://lists.sourceforge.net/lists/admindb/pythoncad-developer
> > >>
> > >> to approve or deny the request.
> > >>
> > >
> > >
> >
|