def breakLinks(self, empID): #break external links, but don't change existing emp file for archive purposes tempEmp = employee(empID) tempEmp.inFile() #remove each project and all superiors/subordinates for projID, projHier in tempEmp.retProjList(): for sub in projHier.retSub(): tempEmp = employee(sub) tempEmp.inFile() tempEmp.remProjSup(projID, empID, 0) #remove sup from sub, no push for sup in projHier.retSup(): tempEmp = employee(sup) tempEmp.inFile() tempEmp.remProjSub(projID, empID, 0) #remove sup from sub, no push #remove emp from Proj from ProjClass import project tempProj = project(projID, "") tempProj.inFile() tempProj.remEmp(empID) for skID, skLvl in tempEmp.retSkillList(): tempSk = ability(skID, "temp", "Skill") tempSk.inFile() tempSk.remEmp(empID) for intID, intLvl in tempEmp.retIntList(): tempInt = ability(intID, "temp", "Int") tempInt.inFile() tempInt.remEmp(empID) return 1
def breakLinks(self,empID): #break external links, but don't change existing emp file for archive purposes tempEmp=employee(empID) tempEmp.inFile() #remove each project and all superiors/subordinates for projID,projHier in tempEmp.retProjList(): for sub in projHier.retSub(): tempEmp=employee(sub) tempEmp.inFile() tempEmp.remProjSup(projID,empID,0)#remove sup from sub, no push for sup in projHier.retSup(): tempEmp=employee(sup) tempEmp.inFile() tempEmp.remProjSub(projID,empID,0)#remove sup from sub, no push #remove emp from Proj from ProjClass import project tempProj = project(projID,"") tempProj.inFile() tempProj.remEmp(empID) for skID,skLvl in tempEmp.retSkillList(): tempSk=ability(skID,"temp","Skill") tempSk.inFile() tempSk.remEmp(empID) for intID,intLvl in tempEmp.retIntList(): tempInt=ability(intID,"temp","Int") tempInt.inFile() tempInt.remEmp(empID) return 1
def renameAbil(self,abilID,newNm): self.inFile() tempAbil=ability(abilID,"",self.kind) tempAbil.inFile() tempAbil.rename(newNm) self.abilList[abilID]=newNm self.outFile()
def remSkill(self, skID): self.inFile() from AbilClass import ability self.skills.pop(skID) tempSk = ability(skID, "temp", "Skill") tempSk.inFile() tempSk.remEmp(self.id) self.outFile()
def remInt(self, intID): self.inFile() from AbilClass import ability self.interests.pop(intID) tempInt = ability(intID, "temp", "Int") tempInt.inFile() tempInt.remEmp(self.id) self.outFile()
def remInt(self,intID): self.inFile() from AbilClass import ability self.interests.pop(intID) tempInt=ability(intID,"temp","Int") tempInt.inFile() tempInt.remEmp(self.id) self.outFile()
def remSkill(self,skID): self.inFile() from AbilClass import ability self.skills.pop(skID) tempSk=ability(skID,"temp","Skill") tempSk.inFile() tempSk.remEmp(self.id) self.outFile()
def addAbil(self,abilName): #Add to master list #Assuming it has already been checked to not be in list self.inFile() self.lastID+=1 tempClass = ability(self.lastID,abilName,self.kind) self.abilList[self.lastID]=abilName self.outFile() #write updated file tempClass.outFile() #create and write the class file return self.lastID
def addInt(self,intID,intLvl): #TODO called from employee after confirming interests exists in master list self.inFile() from AbilClass import ability if not self.interests.has_key(intID): self.interests[intID]=intLvl tempInt=ability(intID,"TempName","Int") tempInt.inFile() tempInt.addEmp(self.id,intLvl) #Add to Ability level list self.outFile()
def addSkill(self,skID,skLvl): #TODO called from employee after confirming skill exists in master list self.inFile() from AbilClass import ability if not self.skills.has_key(skID): self.skills[skID]=skLvl tempSk=ability(skID,"TempName","Skill") tempSk.inFile() tempSk.addEmp(self.id,skLvl) self.outFile()
def addSkill(self, skID, skLvl): #TODO called from employee after confirming skill exists in master list self.inFile() from AbilClass import ability if not self.skills.has_key(skID): self.skills[skID] = skLvl tempSk = ability(skID, "TempName", "Skill") tempSk.inFile() tempSk.addEmp(self.id, skLvl) self.outFile()
def addInt(self, intID, intLvl): #TODO called from employee after confirming interests exists in master list self.inFile() from AbilClass import ability if not self.interests.has_key(intID): self.interests[intID] = intLvl tempInt = ability(intID, "TempName", "Int") tempInt.inFile() tempInt.addEmp(self.id, intLvl) #Add to Ability level list self.outFile()
def chgIntLvl(self,intID,intLvl): self.inFile() from AbilClass import ability if self.interests.has_key(intID): self.interests[intID]=intLvl tempSk=ability(intID,"TempName","Int") tempSk.inFile() tempSk.chgLvl(self.id,intLvl) self.outFile() else: return -1 #This skill doesn't exist
def chgSkillLvl(self,skID,skLvl): self.inFile() from AbilClass import ability if self.skills.has_key(skID): self.skills[skID]=skLvl tempSk=ability(skID,"TempName","Skill") tempSk.inFile() tempSk.chgLvl(self.id,skLvl) self.outFile() else: return -1 #This skill doesn't exist
def chgSkillLvl(self, skID, skLvl): self.inFile() from AbilClass import ability if self.skills.has_key(skID): self.skills[skID] = skLvl tempSk = ability(skID, "TempName", "Skill") tempSk.inFile() tempSk.chgLvl(self.id, skLvl) self.outFile() else: return -1 #This skill doesn't exist
def chgIntLvl(self, intID, intLvl): self.inFile() from AbilClass import ability if self.interests.has_key(intID): self.interests[intID] = intLvl tempSk = ability(intID, "TempName", "Int") tempSk.inFile() tempSk.chgLvl(self.id, intLvl) self.outFile() else: return -1 #This skill doesn't exist
def remAbil(self,abilID): self.inFile() tempAbil=ability(abilID,"",self.kind) tempAbil.inFile() from EmpClass import employee #Remove from all employees first for empID, empSk in tempAbil.retList(): tempEmp=employee(empID) tempEmp.inFile() if self.kind=="Int": tempEmp.remInt(abilID) else: tempEmp.remSkill(abilID) #Then remove from the list self.abilList.pop(abilID) self.outFile()