'''KcsComponent,py Author: YangGuang ZhanQi Date: 2005-10-18 ''' import aadAssDataExtraction class Component: '''Get the data of Tribon component by data extraction.''' def __init__(self,compname): self.Component = compname self.dt = aadAssDataExtraction.DataExtraction() self.GetDesc() self.GetType() self.GetGenType() def GetDesc(self): st = "comp('%s').DESC(1)" % self.Component self.dt.ExtractData(st) self.Desc = self.dt.DataResult[0] def GetType(self): st = "comp('%s').type" % self.Component self.dt.ExtractData(st) self.Type = self.dt.DataResult[0] def GetGenType(self): st = "comp('%s').gen_pr.type" % self.Component self.dt.ExtractData(st) self.GenType = self.dt.DataResult[0] if __name__ == "__main__": import KcsComponent import kcs_ui import kcs_util Comp = KcsComponent.Component('BED') # Test Desc Descr = Comp.Desc # Test Type Type = Comp.Type # Test GenType GenType = Comp.GenType if Descr == 'LIT FIXE LARGEUR 850 (JA200) LIT RABATTABLE (JC200) MATELAS (JE200)' \ and Type == 405000 \ and GenType == 'ACC3': kcs_ui.message_confirm('OK') else: kcs_ui.message_confirm('Not OK') kcs_util.exit_program()