> ---------------------
> class constraintsGFTPopup(CalcAmbigDistConstraintsPopup):
>
> def __init__(self, parent,argServer=None, *args, **kw):
>
> self.project = argServer.getProject()
> self.guiParent = parent
> BasePopup.__init__(self, parent=parent, title='My Distance
> Constraints', **kw)
>
> def constraintsGFT(argServer=None):
> GFT=constraintsGFTPopup(argServer.parent,argServer=argServer)
> -------------------
Here if you overwrite the __init__() in a subclass you should call the
__init__() for the immediate superclass, i.e. for
CalcAmbigDistConstraintsPopup rather than BasePopup. Your error was due to
the body() of the constraints popup being called without its __init__()
having been called first.
Also, you probably won't need to pass across the argServer object as the
project can be obtainted from parent.getProject() (parent being Analysis)
also self.project may already be defined in the superlcass __init__().
Try:
class constraintsGFTPopup(CalcAmbigDistConstraintsPopup):
def __init__(self, parent, *args, **kw):
# Possible extra code
CalcAmbigDistConstraintsPopup.__init__(self, parent=parent,
title='My Distance Constraints',**kw)
def constraintsGFT(argServer=None):
GFT=constraintsGFTPopup(argServer.parent)
-------------------------------------------------------------------------------
Dr Tim Stevens Email: [log in to unmask]
Department of Biochemistry [log in to unmask]
University of Cambridge Phone: +44 1223 766018 (office)
80 Tennis Court Road +44 7816 338275 (mobile)
Old Addenbrooke's Site +44 1223 364613 (home)
Cambridge CB2 1GA WWWeb: http://www.bio.cam.ac.uk/~tjs23
United Kingdom http://www.pantonia.co.uk
-------------------------------------------------------------------------------
------ +NH3CH(CH(CH3)OH)C(O)NHCH(CH(CH3)CH2CH3)C(O)NHCH(CH2CH2SCH3)CO2- -------
-------------------------------------------------------------------------------
|