Login | Register
My pages Projects Community openCollabNet

Discussions > users > Re: [maxq-users] Creating a base class

maxq
Discussion topic

Back to topic list

Re: [maxq-users] Creating a base class

Author oliverbock
Full name Oliver Bock
Date 2007-05-22 13:49:49 PDT
Message John,

I cannot quite remember what the Validator stuff does. I think I
tried to get rid of it at one stage, but met with some resistance. I
recommend the Compact base class instead.

Anyway, I'm sure you don't want the Validator stuff in both base
class and your script class. I'd try removing it from your base
class file. Also, you don't need the

>> if __name__ == 'main':

in your base class. It is boilerplate code that instantiates the
test object in your script class. The base class instance will be
automatically created as part of this process.


   Oliver

--
On 23/05/2007, at 01:23, jh wrote:
> I have tried unsuccessfully to create a base class using a
> standard script. I want to put all the functions I use most often
> in this base class. In th file main.py below I have done nothing
> but change the import class to baseClass and added a calle to
> logon. The first time I run it I get the error:
>
> NameError: validatorPkg
>
> The second time I run it (after a baseClass class file is
> generated) I get the error:
>
> ImportError: cannot import name baseClass
>
> I experimented with other jython scripts and have been able to do
> this. I don't understand all that is going on with the first 8
> lines of the standard script and I suspect that this has something
> to do with it. I am guessing that those lines are not executed when
> I try to import from the baseClass file. I also tried moving those
> lines (except the if) inside the class to no avail.

« Previous message in topic | 4 of 4 | Next message in topic »

Messages

Show all messages in topic

Cannot use module "re", why not? Hans Schwaebli <hans_schwaebli at yahoo dot com> Hans Schwaebli <hans_schwaebli at yahoo dot com> 2007-05-19 15:56:19 PDT
     Re: [maxq-users] Cannot use module "re", why not? oliverbock Oliver Bock 2007-05-19 19:29:05 PDT
         Creating a base class hms_suprise john v hite 2007-05-22 08:23:53 PDT
             Re: [maxq-users] Creating a base class oliverbock Oliver Bock 2007-05-22 13:49:49 PDT
Messages per page: