def SetDelegationDict(self, date, delegation, name, assistant, delegateClass): delegationDict = dict() delegationDict[Delegation.DictDate()] = StringUtil.ClearSpace(date) delegationDict[Delegation.DictDelegate()] = StringUtil.ClearSpace( delegation) delegationDict[Delegation.DcitName()] = StringUtil.ClearSpace(name) delegationDict[Delegation.DictAssistant()] = StringUtil.ClearSpace( assistant) delegationDict[Delegation.DictClass()] = delegateClass print(delegationDict) return delegationDict
def SetJpOverlay(self, delegationDict, cv): if delegationDict[Delegation.DcitName()]!=None: cv.drawString(40, 263, delegationDict[Delegation.DcitName()].replace(self.jpStr, "")) if delegationDict[Delegation.DictDate()]!=None and delegationDict[Delegation.DictDelegate()]!=None: cv.drawString(40, 220, delegationDict[Delegation.DictDate()] + " - " + delegationDict[Delegation.DictDelegate()]) if delegationDict[Delegation.DictAssistant()]!=None: cv.drawString(40, 240, delegationDict[Delegation.DictAssistant()]) self.SetJpDelegationOverlay(delegationDict, cv) self.SetJpClassOverlay(delegationDict, cv) cv.save()
def SetChineseOverlay(self, delegationDict, cv): if delegationDict[Delegation.DcitName()]!=None: cv.drawString(40, 280, delegationDict[Delegation.DcitName()].replace(self.jpStr, "")) if delegationDict[Delegation.DictDate()]!=None and delegationDict[Delegation.DictDelegate()]!=None: cv.drawString(40, 230, delegationDict[Delegation.DictDate()] + " - " + delegationDict[Delegation.DictDelegate()]) if delegationDict[Delegation.DictAssistant()]!=None: cv.drawString(40, 255, delegationDict[Delegation.DictAssistant()]) self.SetChineseDelegationOverlay(delegationDict, cv) self.SetChineseClassOverlay(delegationDict, cv) cv.save()
def SetJpDelegationOverlay(self, delegationDict, cv): if delegationDict[Delegation.DictDelegate()].find(DelegationType.Reading())>=0: cv.drawString(19, 158, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.InitialCall())>=0: cv.drawString(19, 147, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.FirstRV())>=0: cv.drawString(19, 134, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.SecondRV())>=0: cv.drawString(19, 122, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.BibleStudy())>=0: cv.drawString(135, 147, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.BibleStudy2())>=0: cv.drawString(135, 147, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.Talk())>=0: cv.drawString(135, 134, "V") #續訪判斷放最後面 elif delegationDict[Delegation.DictDelegate()].find(DelegationType.FirstRV2())>=0: cv.drawString(19, 134, "V") else: print("SetDelegationOverlay else")
def SetChineseDelegationOverlay(self, delegationDict, cv): if delegationDict[Delegation.DictDelegate()].find(DelegationType.Reading())>=0: cv.drawString(15, 190, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.InitialCall())>=0: cv.drawString(15, 175, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.FirstRV())>=0: cv.drawString(15, 160, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.SecondRV())>=0: cv.drawString(15, 150, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.BibleStudy())>=0: cv.drawString(110, 190, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.BibleStudy2())>=0: cv.drawString(110, 190, "V") elif delegationDict[Delegation.DictDelegate()].find(DelegationType.Talk())>=0: cv.drawString(110, 175, "V") #續訪判斷放最後面 elif delegationDict[Delegation.DictDelegate()].find(DelegationType.FirstRV2())>=0: cv.drawString(15, 160, "V") else: print("SetDelegationOverlay else")
def SetJpClassOverlay(self, delegationDict, cv): if delegationDict[Delegation.DictClass()]==1: cv.drawString(19, 97, "V") else: cv.drawString(19, 85, "V")
def SetChineseClassOverlay(self, delegationDict, cv): if delegationDict[Delegation.DictClass()]==1: cv.drawString(15, 120, "V") else: cv.drawString(15, 105, "V")
def SetOverlay(self, delegationDict, cv): if delegationDict[Delegation.DcitName()].find(self.jpStr)>=0: self.SetJpOverlay(delegationDict, cv) else: self.SetChineseOverlay(delegationDict, cv)
def GetOutputPdfName(self, delegationDict): if delegationDict[Delegation.DcitName()].find(self.jpStr)>=0: return self.outputPath + "\\" + self.description + self.jpDescription + delegationDict[Delegation.DcitName()].replace(self.jpStr, "") + ".pdf" else: return self.outputPath + "\\" + self.description + delegationDict[Delegation.DcitName()] + ".pdf"
def WhichS89(self, delegationDict): if delegationDict[Delegation.DcitName()].find(self.jpStr)>=0: return Constant.GetS89J() else: return Constant.GetS89CH()