471,342 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,342 software developers and data experts.

how to include a tiny debug feature in my project ?

hello,

I've large program based, with a GUI based on wxPython,
where the user can add small parts, which I call Bricks.
A new Brick is created by inheriting from the standard-Brick.
The user should only override 1 or 2 functions from the standard-Brick.
The main properties used in those 2 functions have fixed names.
Now I've not a good idea, how I should debug that new-Brick.

Because I don't want to crash the program,
by bugs in the new-Brick,
I put the call to the overriden functions in new-Brick in a try-except statement.
So it won't generate errors,
and besides that,
debugging GUI is a crime,
and I certainly don't want the user to digg into the large program.

So I'm thinking of another approach:
- locate the 2 functions of the new-Brick
- execute them line by line through a exec-statement
- give a print statement of the most important parameters,
after the execution of each line
(The number of lines written by the user will be at most 20 lines)

Is this a good approach ?
If so, how can I execute each line separate ?
If not, what other approach should I use ?

thanks,
Stef Mientki

Dec 13 '07 #1
1 843
Stef Mientki wrote:
hello,

I've large program based, with a GUI based on wxPython,
where the user can add small parts, which I call Bricks.
A new Brick is created by inheriting from the standard-Brick.
The user should only override 1 or 2 functions from the standard-Brick.
The main properties used in those 2 functions have fixed names.
Now I've not a good idea, how I should debug that new-Brick.

Because I don't want to crash the program,
by bugs in the new-Brick,
I put the call to the overriden functions in new-Brick in a try-except
statement. So it won't generate errors,
and besides that,
debugging GUI is a crime,
and I certainly don't want the user to digg into the large program.

So I'm thinking of another approach:
- locate the 2 functions of the new-Brick
- execute them line by line through a exec-statement
- give a print statement of the most important parameters,
after the execution of each line
(The number of lines written by the user will be at most 20 lines)

Is this a good approach ?
If so, how can I execute each line separate ?
If not, what other approach should I use ?
See the module trace.

Diez
Dec 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.