How to use getbool method in tox

Best Python code snippet using tox_python

IAEFWksht.py

Source:IAEFWksht.py Github

copy

Full Screen

1from vb2py.vbfunctions import *2from vb2py.vbdebug import *3def Acct_Calculation():4 if GetBool(IAEFWksht.IsStateRPT) == True and GetBool(USWRALApp.StateRTDD) == True and GetBool(IAEFWksht.DirDeposit) == True:5 ReturnVal = GetString(USWRALApp.StateAccount)6 elif ( GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0 ) or ( GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0 ) :7 count = 18 MaxAcct = GetAllCopies(USWBankAcct)9 Acct = ''10 while count <= MaxAcct:11 if GetString(USWBankAcct.BankAcct, count) != '':12 if GetBool(USWBankAcct.Default, count) == True:13 ReturnVal = GetString(USWBankAcct.BankAcct, count)14 count = 9915 count = count + 116 ReturnVal = ''17 else:18 ReturnVal = ''19def ACH_Calculation():20 if GetNumber(IAEFWksht.Yes) == 1:21 ReturnVal = 022 elif GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0:23 ReturnVal = 124 else:25 ReturnVal = 026def Address_Calculation():27 ReturnVal = GetString(IAF1040.Add) + ' ' + GetString(IAF1040.CityComb)28def AIAWH_Calculation():29 ReturnVal = GetCurrency(IAF1040.AIATaxWith)30def AmtOwed_Calculation():31 ReturnVal = GetCurrency(IAF1040.TotDue)32def ANet_Calculation():33 ReturnVal = GetCurrency(IAF1040.ANet)34def AskBankInfo_Calculation():35 if GetCurrency(IAEFWksht.AmtOwed) > 0:36 ReturnVal = 137 elif GetBool(IAEFWksht.IsStateRPT) == True and GetBool(USWEFQual.FilingSO) == True:38 ReturnVal = 039 elif GetCurrency(IAEFWksht.Refund) > 0:40 ReturnVal = 141 else:42 ReturnVal = 043def AskDebitCard_Calculation():44 if IsPreparer() == True:45 ReturnVal = 046 elif GetBool(USWBankProd.HaveBankConsent) == False:47 ReturnVal = 048 # Do not offer state debit card on linked returns using Republic Direct Deposit RT49 elif GetBool(USWBankProd.DebitCardReturn) == False and GetBool(USWBankProd.RPTReturn) == True:50 ReturnVal = 051 # Do not offer state debit card on state only returns using Republic Direct Deposit RT52 elif GetBool(USWBankProd.IsStateRPT) == True and GetBool(USWRALApp.StateRTDD) == True:53 ReturnVal = 054 elif GetCurrency(IAEFWksht.Refund) < Decimal("10000"):55 ReturnVal = 156 else:57 ReturnVal = 058def AskDriverLic_Calculation():59 if GetBool(USWEFOptions.PiggyBackIA) == True or GetBool(USWEFOptions.SOIA) == True or GetBool(USWEFOptions.SOIAX) == True:60 ReturnVal = 161 else:62 ReturnVal = 063def AskFedStateBank_Calculation():64 if GetBool(IAEFWksht.PrepBPTrans) == True:65 ReturnVal = 166 elif IsPreparer() == True and GetBool(USWBasicInfo.BankProd) == True:67 ReturnVal = 068 elif GetBool(USWBankProd.IsStateRPT) == True and GetBool(USWEFQual.FilingSO) == True:69 ReturnVal = 070 elif GetCurrency(IAEFWksht.Refund) > 0 and GetBool(USWEFWksht.refundbox) == True:71 if GetBool(USWBasicInfo.DebitCard) == True and GetBool(IAEFWksht.AskDebitCard) == False:72 ReturnVal = 073 elif GetBool(IAEFWksht.DebitCard) == True and GetBool(IAEFWksht.AskDebitCard) == False:74 ReturnVal = 075 elif GetBool(USWBasicInfo.DebitCard) == True and GetBool(IAEFWksht.DebitCard) == True:76 ReturnVal = 177 elif GetBool(USWBasicInfo.DirectDepY) == True and GetBool(IAEFWksht.DirDeposit) == True:78 if GetString(USF8888.Account1) == GetString(IAEFWksht.Acct):79 ReturnVal = 180 else:81 ReturnVal = 082 elif GetBool(USWBasicInfo.DirectDepN) == True and GetBool(IAEFWksht.NoDDEFW) == True:83 ReturnVal = 184 else:85 ReturnVal = 086 else:87 ReturnVal = 088def AskSORTDC_Calculation():89 if GetBool(USWEFOptions.SOIA) == False:90 ReturnVal = 091 elif IsPreparer() == True:92 ReturnVal = 093 elif GetBool(USWBankProd.HaveBankConsent) == False:94 ReturnVal = 095 elif GetCurrency(IAEFWksht.Refund) < Decimal("10000"):96 ReturnVal = 197 else:98 ReturnVal = 099def AskStateRT_Calculation():100 if GetBool(USWEFOptions.SOIAX) == True:101 ReturnVal = 0102 elif GetCurrency(IAEFWksht.Refund) >= Decimal("75"):103 ReturnVal = 1104 else:105 ReturnVal = 0106def ATTax_Calculation():107 if GetBool(IARequired.LowInc) == True:108 ReturnVal = 0109 else:110 ReturnVal = GetCurrency(IAF1040.ATotIATax)111def BankName_Calculation():112 if ( GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0 ) or ( GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0 ) :113 count = 1114 MaxAcct = GetAllCopies(USWBankAcct)115 while count <= MaxAcct:116 if GetString(USWBankAcct.BankAcct, count) != '':117 if IsStrEqual(GetString(IAEFWksht.Acct), GetString(USWBankAcct.BankAcct, count)):118 ReturnVal = GetString(USWBankAcct.BankName, count)119 count = 99120 count = count + 1121 ReturnVal = ''122 else:123 ReturnVal = ''124def BankProDisCd_Calculation():125 Submission = String()126 TempStr = String()127 #Bank Product Disbursement Declaration128 #0 = Did Not Select bank product Option; 1 = Selected Debit Card Option; 2 = Selected Direct Depoist to the Bank; 3 = Requestd a Check;129 #Parameter 6 = Refund Owe Method: 0-No method; 1-AmEx debit card; 2-State issued debit card; 3-Direct deposit no Republic Bank; 4-Direct deposit through Republic Bank; 5-Paper check (refund); 6-AmEx debit card through Republic; 10-Direct debit; 11-Credit card; 12-Paper check (owe); 13-IRS EFTPS130 TempStr = GetString(IAEFWksht.EFSubmission)131 Submission = GetParam(TempStr, 1, '|')132 if GetParam(Submission, 6, ';') == '0':133 ReturnVal = '0'134 elif GetParam(Submission, 6, ';') == '1':135 ReturnVal = '1'136 elif GetParam(Submission, 6, ';') == '2':137 ReturnVal = '3'138 elif GetParam(Submission, 6, ';') == '3':139 ReturnVal = '2'140 elif GetParam(Submission, 6, ';') == '4':141 ReturnVal = '2'142 elif GetParam(Submission, 6, ';') == '5':143 ReturnVal = '3'144 elif GetParam(Submission, 6, ';') == '6':145 ReturnVal = '1'146 else:147 ReturnVal = '0'148def BIAWH_Calculation():149 ReturnVal = GetCurrency(IAF1040.BIATaxWith)150def BNet_Calculation():151 ReturnVal = GetCurrency(IAF1040.BNet)152def BP_Calculation():153 if GetBool(IAEFWksht.PrepBPTrans) == True:154 ReturnVal = 1155 else:156 ReturnVal = 0157def BTTax_Calculation():158 if GetBool(IARequired.LowInc) == True:159 ReturnVal = 0160 else:161 ReturnVal = GetCurrency(IAF1040.BTotIATax)162def CompStateEFQA_Calculation():163 # If not filing Iowa return, always return False164 if GetBool(USWEFOptions.PiggyBackIA) == False and GetBool(USWEFOptions.SOIA) == False and GetBool(USWEFOptions.SOIAX) == False:165 ReturnVal = 0166 elif GetCurrency(IAEFWksht.Refund) > 0:167 if GetBool(IAEFWksht.PrepRevQA) == False:168 ReturnVal = 1169 elif IsPreparer() == True and GetBool(IAEFWksht.PrepBPTrans) == True:170 ReturnVal = 0171 elif GetBool(USWBankProd.DebitCardReturn) == True and GetBool(IAEFWksht.DebitCard) == False and GetBool(IAEFWksht.DirDeposit) == False and GetBool(IAEFWksht.NoDDEFW) == False:172 ReturnVal = 1173 elif GetBool(IAEFWksht.DirDeposit) == False and GetBool(IAEFWksht.NoDDEFW) == False:174 ReturnVal = 1175 elif GetBool(USWBankProd.DebitCardReturn) == False and GetBool(IAEFWksht.DirDeposit) == False and GetBool(IAEFWksht.NoDDEFW) == False:176 ReturnVal = 1177 elif GetBool(IAEFWksht.DirDeposit) == True and GetNumber(USFInterview.ValidBankAccts) == 0:178 ReturnVal = 1179 else:180 ReturnVal = 0181 elif GetCurrency(IAEFWksht.AmtOwed) > 0:182 if GetBool(IAEFWksht.PrepRevQA) == False:183 ReturnVal = 1184 elif GetBool(IAEFWksht.EFW) == False and GetBool(IAEFWksht.NoDDEFW) == False:185 ReturnVal = 1186 elif GetBool(IAEFWksht.EFW) == True and GetNumber(USFInterview.ValidBankAccts) == 0:187 ReturnVal = 1188 else:189 ReturnVal = 0190 else:191 ReturnVal = 0192def DANChange_Calculation():193 ReturnVal = GetString(IAEFWksht.DirDepDan) + '|'194def DC_Calculation():195 if GetBool(IAEFWksht.PrepBPTrans) == True:196 ReturnVal = 0197 elif GetBool(IAEFWksht.DebitCard) == True and GetCurrency(IAEFWksht.Refund) > 0:198 ReturnVal = 1199 else:200 ReturnVal = 0201def DD_Calculation():202 if GetNumber(IAEFWksht.Yes) == 1:203 ReturnVal = 0204 elif GetBool(IAEFWksht.PrepBPTrans) == True:205 ReturnVal = 0206 elif GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0:207 ReturnVal = 1208 else:209 ReturnVal = 0210def DebitCard_Calculation():211 if GetBool(IAEFWksht.IsStateRPT) == True:212 if GetBool(USWRALApp.StateRTDC) == True and GetBool(IAEFWksht.AskDebitCard) == True:213 ReturnVal = 1214 else:215 ReturnVal = 0216 elif GetBool(USWBasicInfo.DebitCard) == True and GetCurrency(USF1040.RefundOwe) > 0 and GetBool(IAEFWksht.AskDebitCard) == True:217 if GetCurrency(IAEFWksht.Refund) > 0:218 ReturnVal = 1219 else:220 ReturnVal = 0221 else:222 ReturnVal = 0223def Desc_Calculation():224 ReturnVal = GetString(IARequired.CombNames)225def DirDepChecking_Calculation():226 if ( GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0 ) or ( GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0 ) :227 count = 1228 MaxAcct = GetAllCopies(USWBankAcct)229 while count <= MaxAcct:230 if GetString(USWBankAcct.BankAcct, count) != '':231 if IsStrEqual(GetString(IAEFWksht.Acct), GetString(USWBankAcct.BankAcct, count)):232 ReturnVal = GetBool(USWBankAcct.Checking, count)233 count = 99234 count = count + 1235 ReturnVal = 0236 else:237 ReturnVal = 0238def DirDepDan_Calculation():239 if ( GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0 ) or ( GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0 ) :240 count = 1241 MaxAcct = GetAllCopies(USWBankAcct)242 while count <= MaxAcct:243 if GetString(USWBankAcct.BankAcct, count) != '':244 if IsStrEqual(GetString(IAEFWksht.Acct), GetString(USWBankAcct.BankAcct, count)):245 ReturnVal = GetString(USWBankAcct.AcctNum, count)246 count = 99247 count = count + 1248 ReturnVal = ''249 else:250 ReturnVal = ''251def DirDeposit_Calculation():252 if GetBool(IAEFWksht.IsStateRPT) == True:253 if GetBool(USWRALApp.StateRTDD) == True:254 ReturnVal = 1255 else:256 ReturnVal = 0257 elif GetBool(USWBasicInfo.DirectDepY) == True and GetCurrency(USF1040.RefundOwe) > 0:258 if GetCurrency(IAEFWksht.Refund) > 0:259 ReturnVal = 1260 else:261 ReturnVal = 0262 else:263 ReturnVal = 0264def DirDepRTN_Calculation():265 if ( GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0 ) or ( GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0 ) :266 count = 1267 MaxAcct = GetAllCopies(USWBankAcct)268 while count <= MaxAcct:269 if GetString(USWBankAcct.BankAcct, count) != '':270 if IsStrEqual(GetString(IAEFWksht.Acct), GetString(USWBankAcct.BankAcct, count)):271 ReturnVal = GetString(USWBankAcct.RTN, count)272 count = 99273 count = count + 1274 ReturnVal = ''275 else:276 ReturnVal = ''277def DirDepSavings_Calculation():278 if ( GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0 ) or ( GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0 ) :279 count = 1280 MaxAcct = GetAllCopies(USWBankAcct)281 while count <= MaxAcct:282 if GetString(USWBankAcct.BankAcct, count) != '':283 if IsStrEqual(GetString(IAEFWksht.Acct), GetString(USWBankAcct.BankAcct, count)):284 ReturnVal = GetBool(USWBankAcct.Savings, count)285 count = 99286 count = count + 1287 ReturnVal = 0288 else:289 ReturnVal = 0290def DirDepTrigger_Calculation():291 if GetNumber(IAEFWksht.EFDDCode) == 1:292 ReturnVal = 1293 else:294 ReturnVal = 0295def DirectDepY_Calculation():296 if GetBool(IAEFWksht.DD) == True:297 if GetBool(USWBankProd.RPTReturn) == True and GetBool(IAEFWksht.SameFedBank) == True:298 ReturnVal = 1299 elif GetBool(IAEFWksht.IsStateRPT) == True:300 ReturnVal = 1301 else:302 ReturnVal = 0303 elif GetBool(IAEFWksht.DC) == True:304 if GetBool(USWBankProd.RPTReturn) == True:305 ReturnVal = 1306 elif GetBool(IAEFWksht.IsStateRPT) == True:307 ReturnVal = 1308 else:309 ReturnVal = 0310 else:311 ReturnVal = 0312def EFAvailable_Calculation():313 if GetBool(IA1040X.EFAmend) == True:314 ReturnVal = 'IAX,2, Amended|'315 else:316 ReturnVal = 'IA,0,|'317def EFChecking_Calculation():318 if GetBool(IAEFWksht.PrepBPTrans) == True:319 ReturnVal = GetBool(USWEFWkSht2.DirDepChk)320 elif GetBool(IAEFWksht.DebitCard) == True and GetCurrency(IAEFWksht.Refund) > 0:321 ReturnVal = 1322 elif GetNumber(IAEFWksht.EFDDCode) != 0:323 ReturnVal = GetBool(IAEFWksht.DirDepChecking)324 else:325 ReturnVal = 0326def EFDan_Calculation():327 if GetBool(IAEFWksht.PrepBPTrans) == True:328 ReturnVal = GetString(USWEFWkSht2.DirDepDan)329 elif GetBool(IAEFWksht.DebitCard) == True and GetCurrency(IAEFWksht.Refund) > 0:330 ReturnVal = GetString(USWDebitCard.AcctNum)331 elif GetNumber(IAEFWksht.EFDDCode) != 0:332 ReturnVal = GetString(IAEFWksht.DirDepDan)333 else:334 ReturnVal = ''335def EFDDCode_Calculation():336 if GetBool(IAEFWksht.PrepBPTrans) == True:337 ReturnVal = 1338 elif GetBool(IAEFWksht.DebitCard) == True and GetCurrency(IAEFWksht.Refund) > 0:339 ReturnVal = 1340 elif GetNumber(IAEFWksht.Yes) == 1:341 ReturnVal = 0342 elif GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0:343 ReturnVal = 1344 elif GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0:345 ReturnVal = 2346 else:347 ReturnVal = 0348def EFDedCode_Calculation():349 if GetBool(IARequired.LowInc) == True:350 ReturnVal = ''351 elif GetBool(IAF1040.ItemCheck) == True:352 ReturnVal = '1'353 else:354 ReturnVal = '3'355def EFEFWAmt_Calculation():356 if GetNumber(IAEFWksht.EFDDCode) == 2:357 ReturnVal = GetCurrency(IAEFWksht.AmtOwed)358 else:359 ReturnVal = 0360def EFEFWDate_Calculation():361 if GetNumber(IAEFWksht.EFDDCode) == 2:362 ReturnVal = GetString(IAEFWksht.EFWDate)363 else:364 ReturnVal = ''365def EFRtn_Calculation():366 if GetBool(IAEFWksht.PrepBPTrans) == True:367 ReturnVal = GetString(USWEFWkSht2.DirDepRTN)368 elif GetBool(IAEFWksht.DebitCard) == True and GetCurrency(IAEFWksht.Refund) > 0:369 ReturnVal = GetString(USWDebitCard.RTN)370 elif GetNumber(IAEFWksht.EFDDCode) != 0:371 ReturnVal = GetString(IAEFWksht.DirDepRTN)372 else:373 ReturnVal = ''374def EFSavings_Calculation():375 if GetBool(IAEFWksht.PrepBPTrans) == True:376 ReturnVal = GetBool(USWEFWkSht2.DirDepSav)377 elif GetBool(IAEFWksht.DebitCard) == True and GetCurrency(IAEFWksht.Refund) > 0:378 ReturnVal = 0379 elif GetNumber(IAEFWksht.EFDDCode) != 0:380 ReturnVal = GetBool(IAEFWksht.DirDepSavings)381 else:382 ReturnVal = 0383def EFSpInit_Calculation():384 if GetBool(IAF1040.MFJ) == True or GetBool(IAF1040.CombMFS) == True:385 ReturnVal = GetString(USWBasicInfo.SpInit)386 else:387 ReturnVal = ''388def EFSpLast_Calculation():389 if GetBool(IAF1040.MFJ) == True or GetBool(IAF1040.CombMFS) == True:390 ReturnVal = GetString(USWBasicInfo.SPLast)391 else:392 ReturnVal = ''393def EFSpouseFirst_Calculation():394 if GetBool(IAF1040.MFJ) == True or GetBool(IAF1040.CombMFS) == True:395 ReturnVal = GetString(USWBasicInfo.SpouseFirst)396 else:397 ReturnVal = ''398def EFSpSuffix_Calculation():399 if GetBool(IAF1040.MFJ) == True or GetBool(IAF1040.CombMFS) == True:400 ReturnVal = GetString(USWBasicInfo.SPSuffix)401 else:402 ReturnVal = ''403def EFStRefund_Calculation():404 if GetBool(USWEFOptions.PiggyBackIA) == True:405 if GetCurrency(IAEFWksht.Refund) > 0:406 ReturnVal = 1407 else:408 ReturnVal = 0409 else:410 ReturnVal = 0411def EFSubmission_Calculation():412 RefOweMethod = String()413 # General Guideline to follow (use | bar if more than 1 return can be filed)414 # Parameter 1 = Module Name415 # Parameter 2 = Return Type: 0-Return; 1-Extension; 2-Amended; 3-Special1; 4-SpecialTaxpayer; 5-SpecialTaxpayerExtension; 6-SpecialSpouse; 7-SpecialSpouseExtension; 8-NewYorkLLC; 9-Special416 # Parameter 3 = EF Type: 0-Legacy; 1-Qualifies for MeF (used if state supports legacy); 2-Must Be MeF (always used if state does not support legacy)417 # Parameter 4 = Fed XML Version: 0-Send no federal XML; 1-Send accepted federal; 2-Send federal XML used to complete state return418 # Parameter 5 = Special Description: description for special returns, if none space419 # Parameter 6 = Refund Owe Method: 0-No method; 1-AmEx debit card; 2-State issued debit card; 3-Direct deposit no Republic Bank; 4-Direct deposit through Republic Bank; 5-Paper check (refund); 6-AmEx debit card through Republic; 10-Direct debit; 11-Credit card; 12-Paper check (owe); 13-IRS EFTPS420 if GetBool(USWEFOptions.PiggyBackIA) == True or GetBool(USWEFOptions.SOIA) == True:421 if GetCurrency(IAF1040.RefBalDue) == 0:422 RefOweMethod = '0'423 elif GetBool(IAEFWksht.PrepBPTrans) == True:424 RefOweMethod = '4'425 elif GetBool(IAEFWksht.DC) == True:426 if GetBool(USWBankProd.RPTReturn) == True:427 RefOweMethod = '6'428 elif GetBool(IAEFWksht.IsStateRPT) == True:429 RefOweMethod = '6'430 else:431 RefOweMethod = '1'432 elif GetBool(IAEFWksht.DD) == True:433 if GetBool(USWBankProd.RPTReturn) == True and GetBool(IAEFWksht.SameFedBank) == True:434 RefOweMethod = '4'435 elif GetBool(IAEFWksht.IsStateRPT) == True:436 RefOweMethod = '4'437 else:438 RefOweMethod = '3'439 elif GetCurrency(IAF1040.RefBalDue) > 0:440 RefOweMethod = '5'441 elif GetString(IAEFWksht.EFDDCode) == '2':442 RefOweMethod = '10'443 else:444 RefOweMethod = '12'445 elif GetBool(USWEFOptions.SOIAX) == True:446 if GetCurrency(IAF1040.RefBalDue) == 0:447 RefOweMethod = '0'448 elif GetBool(IAEFWksht.DD) == True:449 RefOweMethod = '3'450 elif GetCurrency(IAF1040.RefBalDue) > 0:451 RefOweMethod = '5'452 elif GetString(IAEFWksht.EFDDCode) == '2':453 RefOweMethod = '10'454 else:455 RefOweMethod = '12'456 else:457 RefOweMethod = '0'458 if GetBool(USWEFOptions.PiggyBackIA) == True or GetBool(USWEFOptions.SOIA) == True:459 ReturnVal = 'IA;0;2;2; ;' + RefOweMethod + '|'460 elif GetBool(USWEFOptions.SOIAX) == True:461 ReturnVal = 'IA;2;2;2;Amended;' + RefOweMethod + '|'462 else:463 ReturnVal = ''464def EROAddress_Calculation():465 if IsPreparer() == True:466 ReturnVal = GetString(USWBasicInfo.EROAddress)467 else:468 ReturnVal = ''469def EROCityComb_Calculation():470 if IsPreparer() == False:471 ReturnVal = ''472 elif Trim(GetString(USWBasicInfo.EROForCtry)) != '':473 if Trim(GetString(USWBasicInfo.EROForProvince)) != '' and Trim(GetString(USWBasicInfo.EROForPC)) != '':474 ReturnVal = GetString(USWBasicInfo.EROCity) + ', ' + GetString(USWBasicInfo.EROForProvince) + ', ' + GetString(USWBasicInfo.EROForPC) + ', ' + GetString(USWBasicInfo.EROForCtry)475 elif Trim(GetString(USWBasicInfo.EROForProvince)) != '':476 ReturnVal = GetString(USWBasicInfo.EROCity) + ', ' + GetString(USWBasicInfo.EROForProvince) + ', ' + GetString(USWBasicInfo.EROForCtry)477 elif Trim(GetString(USWBasicInfo.EROForPC)) != '':478 ReturnVal = GetString(USWBasicInfo.EROCity) + ', ' + GetString(USWBasicInfo.EROForPC) + ', ' + GetString(USWBasicInfo.EROForCtry)479 else:480 ReturnVal = GetString(USWBasicInfo.EROCity) + ', ' + GetString(USWBasicInfo.EROForCtry)481 elif Trim(GetString(USWBasicInfo.EROCity)) != '':482 ReturnVal = GetString(USWBasicInfo.EROCity) + ', ' + GetString(USWBasicInfo.StateAbbERO) + ' ' + GetString(USWBasicInfo.EROZip)483 else:484 ReturnVal = GetString(USWBasicInfo.StateAbbERO) + ' ' + GetString(USWBasicInfo.EROZip)485def EROEIN_Calculation():486 if IsPreparer() == True:487 ReturnVal = GetString(USWBasicInfo.EROEIN)488 else:489 ReturnVal = ''490def EROFirmName_Calculation():491 if IsPreparer() == True:492 ReturnVal = GetString(USWBasicInfo.EROFirmName)493 else:494 ReturnVal = ''495def EROPhone_Calculation():496 if IsPreparer() == False:497 ReturnVal = ''498 elif Trim(GetString(USWBasicInfo.EROPhone)) != '':499 ReturnVal = GetString(USWBasicInfo.EROPhone)500 else:501 ReturnVal = GetString(USWBasicInfo.EROForPhone)502def EROPrep_Calculation():503 if IsPreparer() == True:504 ReturnVal = GetBool(USWBasicInfo.PaidPrepY)505 else:506 ReturnVal = 0507def EROSE_Calculation():508 if IsPreparer() == True:509 ReturnVal = GetBool(USWBasicInfo.EROSelfEmp)510 else:511 ReturnVal = 0512def EROSSN_Calculation():513 EROPTIN = String()514 EROPTIN = LetterStr(GetString(USWBasicInfo.EROSSN))515 if IsPreparer() == True and IsStrEqual(EROPTIN, 'P'):516 ReturnVal = GetString(USWBasicInfo.EROSSN)517 else:518 ReturnVal = ''519def Exist_Calculation():520 ReturnVal = 1521def FedChecking_Calculation():522 if GetCurrency(USWBasicInfo.WithdrawalAmt) > 0 and GetDate(USWBasicInfo.withdrawldate) != '':523 ReturnVal = GetBool(USWBasicInfo.ACHChecking)524 else:525 ReturnVal = GetBool(USF8888.EFChecking(0))526def FedDAN_Calculation():527 if GetCurrency(USWBasicInfo.WithdrawalAmt) > 0 and GetDate(USWBasicInfo.withdrawldate) != '':528 ReturnVal = GetString(USWBasicInfo.ACHDAN)529 else:530 ReturnVal = GetString(USF8888.EFAcctNum(0))531def FedRTN_Calculation():532 if GetCurrency(USWBasicInfo.WithdrawalAmt) > 0 and GetDate(USWBasicInfo.withdrawldate) != '':533 ReturnVal = GetString(USWBasicInfo.ACHRTN)534 else:535 ReturnVal = GetString(USF8888.EFRtn(0))536def FedSavings_Calculation():537 if GetCurrency(USWBasicInfo.WithdrawalAmt) > 0 and GetDate(USWBasicInfo.withdrawldate) != '':538 ReturnVal = GetBool(USWBasicInfo.ACHSavings)539 else:540 ReturnVal = GetBool(USF8888.EFSaveAcct(0))541def FedTrans_Calculation():542 #If (GetBool(IAEFWksht.DirDeposit) = True And GetCurrency(IAEFWksht.Refund) > 0) Or (GetBool(IAEFWksht.EFW) = True And GetCurrency(IAEFWksht.AmtOwed) > 0) Then543 # If GetBool(IAEFWksht.TransInfo) = True Then544 # ReturnVal = 1545 # Else546 # ReturnVal = 0547 # End If548 #Else549 ReturnVal = 0550 #End If551def FinTransTrigger_Calculation():552 if GetNumber(IAEFWksht.EFDDCode) != 0:553 ReturnVal = 1554 elif GetNumber(IAEstimates.EstEFW, 1) > 0 or GetNumber(IAEstimates.EstEFW, 2) > 0:555 ReturnVal = 1556 else:557 ReturnVal = 0558def ForCity_Calculation():559 ReturnVal = GetString(USWBasicInfo.ForCity)560def ForCountry_Calculation():561 ReturnVal = GetString(USWBasicInfo.ForCountry)562def ForStreet_Calculation():563 ReturnVal = GetString(USWBasicInfo.ForStreet)564def IsStateRPT_Calculation():565 if GetBool(IAEFWksht.AskStateRT) == False:566 ReturnVal = 0567 elif GetBool(USWBankProd.ClearedInvoiceFees) == True:568 ReturnVal = 0569 elif GetBool(USWRALApp.StateRTDC) == True and GetBool(IAEFWksht.AskSORTDC) == False:570 ReturnVal = 0571 elif GetBool(USWBankProd.StateRPT) == True and GetBool(USWBankProd.StateBankAgree) == True and GetBool(USWBankProd.StateBankAgree2) == True and GetCurrency(IAEFWksht.Refund) > 0:572 ReturnVal = 1573 else:574 ReturnVal = 0575def MeFPrepInfo_Calculation():576 if IsPreparer() == True:577 if GetBool(USWBasicInfo.NoPrep) == False:578 ReturnVal = 1579 else:580 ReturnVal = 0581 else:582 ReturnVal = 0583def MeFSP137_Calculation():584 if GetNumber(IA137.MEF137SP, FieldCopies(IA137.Spouse)) > 0:585 ReturnVal = 1586 else:587 ReturnVal = 0588def MeFTP137_Calculation():589 if GetNumber(IA137.MEF137TP, FieldCopies(IA137.Taxpayer)) > 0:590 ReturnVal = 1591 else:592 ReturnVal = 0593def Need8453_Calculation():594 ReturnVal = 1595def No_Calculation():596 if ( GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0 ) or ( GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0 ) :597 if GetBool(IAEFWksht.Yes) == True:598 ReturnVal = 0599 else:600 ReturnVal = 1601 else:602 ReturnVal = 0603def NoBankSel_Calculation():604 if GetBool(IAEFWksht.DirDeposit) == True or GetBool(IAEFWksht.EFW):605 if Trim(GetString(IAEFWksht.Acct)) == '':606 ReturnVal = 1607 else:608 ReturnVal = 0609 else:610 ReturnVal = 0611def NoBankSelInt_Calculation():612 if ( GetBool(IAEFWksht.DirDeposit) == True ) or ( GetBool(IAEFWksht.EFW) == True ) :613 if GetBool(USTopicList.HaveBankWSSend) == False:614 ReturnVal = 0615 elif Trim(GetString(IAEFWksht.Acct)) == '':616 ReturnVal = 1617 else:618 ReturnVal = 0619 else:620 ReturnVal = 0621def NoDDEFW_Calculation():622 if GetBool(IAEFWksht.IsStateRPT) == True:623 ReturnVal = 0624 elif GetBool(USWBasicInfo.DirectDepN) == True and GetCurrency(USF1040.RefundOwe) > 0:625 if GetCurrency(IAEFWksht.Refund) > 0:626 ReturnVal = 1627 else:628 ReturnVal = 0629 else:630 ReturnVal = 0631def NonForCity_Calculation():632 ReturnVal = GetString(USWBasicInfo.NonForCity)633def NonForState_Calculation():634 ReturnVal = GetString(USWBasicInfo.NonForState)635def NonForStreet_Calculation():636 ReturnVal = GetString(USWBasicInfo.NonForStreet)637def NonForZip_Calculation():638 ReturnVal = GetString(USWBasicInfo.NonForZip)639def PC_Calculation():640 if GetCurrency(IAEFWksht.Refund) == 0:641 ReturnVal = 0642 elif GetBool(IAEFWksht.DD) == False and GetBool(IAEFWksht.BP) == False and GetBool(IAEFWksht.DC) == False:643 ReturnVal = 1644 else:645 ReturnVal = 0646def PrBankName_Calculation():647 if GetNumber(IAEFWksht.EFDDCode) != 0 and GetBool(IAEFWksht.DebitCard) == False and GetBool(IAEFWksht.PrepBPTrans) == False:648 ReturnVal = GetString(IAEFWksht.BankName)649 else:650 ReturnVal = ''651def PrChecking_Calculation():652 if GetNumber(IAEFWksht.EFDDCode) != 0 and GetBool(IAEFWksht.DebitCard) == False and GetBool(IAEFWksht.PrepBPTrans) == False:653 ReturnVal = GetBool(IAEFWksht.DirDepChecking)654 else:655 ReturnVal = 0656def PrDAN_Calculation():657 if GetNumber(IAEFWksht.EFDDCode) != 0 and GetBool(IAEFWksht.DebitCard) == False and GetBool(IAEFWksht.PrepBPTrans) == False:658 ReturnVal = GetString(IAEFWksht.DirDepDan)659 else:660 ReturnVal = ''661def PrepAddress_Calculation():662 if IsPreparer() == True:663 if GetBool(IAEFWksht.EROPrep) == False:664 ReturnVal = GetString(USWBasicInfo.PrepAdd)665 else:666 ReturnVal = ''667 else:668 ReturnVal = ''669def PrepBPTrans_Calculation():670 if GetBool(USWRALApp.RepRouteState) == False:671 ReturnVal = 0672 elif IsPreparer() == False:673 ReturnVal = 0674 elif GetBool(USWBasicInfo.BankProd) == True and GetCurrency(USF1040.RefundOwe) > 0:675 if GetBool(USWBankProd.Republic) == True and GetBool(IAEFWksht.EFStRefund) == True:676 ReturnVal = 1677 else:678 ReturnVal = 0679 else:680 ReturnVal = 0681def PrepCityComb_Calculation():682 if IsPreparer() == True:683 if GetBool(IAEFWksht.EROPrep) == False:684 ReturnVal = GetString(USWBasicInfo.CombPrepCityStZipFor)685 else:686 ReturnVal = ''687 else:688 ReturnVal = ''689def PrepEIN_Calculation():690 if IsPreparer() == True:691 if GetBool(IAEFWksht.EROPrep) == False:692 ReturnVal = GetString(USWBasicInfo.PrepEIN)693 else:694 ReturnVal = ''695 else:696 ReturnVal = ''697def PrepFirmName_Calculation():698 if IsPreparer() == True:699 if GetBool(IAEFWksht.EROPrep) == False:700 ReturnVal = GetString(USWBasicInfo.PrepName)701 else:702 ReturnVal = ''703 else:704 ReturnVal = ''705def PrepPhone_Calculation():706 if IsPreparer() == True:707 if GetBool(IAEFWksht.EROPrep) == False:708 ReturnVal = GetString(IAF1040.PrepPhone)709 else:710 ReturnVal = ''711 else:712 ReturnVal = ''713def PrepSE_Calculation():714 if IsPreparer() == True:715 if GetBool(IAEFWksht.EROPrep) == False:716 ReturnVal = GetBool(USWBasicInfo.SelfEm)717 else:718 ReturnVal = 0719 else:720 ReturnVal = 0721def PrepSSN_Calculation():722 if IsPreparer() == True:723 if GetBool(IAEFWksht.EROPrep) == False:724 ReturnVal = GetString(USWBasicInfo.PrepSSN)725 else:726 ReturnVal = ''727 else:728 ReturnVal = ''729def PrERODate_Calculation():730 if GetBool(IAEFWksht.EROPrep) == True:731 ReturnVal = GetString(USWBasicInfo.PrPrepDate)732 else:733 ReturnVal = ''734def PrEROSig_Calculation():735 if GetBool(IAEFWksht.EROPrep) == True:736 ReturnVal = GetString(USWBasicInfo.PrPrepSig)737 else:738 ReturnVal = ''739def PrintReturn_Calculation():740 PrintList_Clear(PrintList_EF)741 if Trim(GetString(IAEFWksht.EFSubmission)) != '':742 if GetBool(IA1040X.EFAmend) == True:743 PrintList_AddHTML(PrintList_EF, EFReturnType_AmendedReturn, 'E-filing Instructions', 'ia instructions/IAWEFFilingInst.htm')744 if GetBool(IAEFWksht.Need8453) == True:745 PrintList_AddCustom(PrintList_EF, EFReturnType_AmendedReturn, 'Form 8453', 'PrintEFileForms')746 PrintList_AddReturn(PrintList_EF, EFReturnType_AmendedReturn, 'Amended Return')747 else:748 PrintList_AddHTML(PrintList_EF, EFReturnType_Return, 'E-filing Instructions', 'ia instructions/IAWEFFilingInst.htm')749 if GetBool(IAEFWksht.Need8453) == True:750 PrintList_AddCustom(PrintList_EF, EFReturnType_Return, 'Form 8453', 'PrintEFileForms')751 PrintList_AddReturn(PrintList_EF, EFReturnType_Return, 'Return')752 ReturnVal = ''753def PrPrepDate_Calculation():754 if IsPreparer() == True:755 if GetBool(IAEFWksht.EROPrep) == False:756 ReturnVal = GetString(USWBasicInfo.PrPrepDate)757 else:758 ReturnVal = ''759 else:760 ReturnVal = ''761def PrPrepSig_Calculation():762 if IsPreparer() == True:763 if GetBool(IAEFWksht.EROPrep) == False:764 ReturnVal = GetString(USWBasicInfo.PrPrepSig)765 else:766 ReturnVal = ''767 else:768 ReturnVal = ''769def PrRtn_Calculation():770 if GetNumber(IAEFWksht.EFDDCode) != 0 and GetBool(IAEFWksht.DebitCard) == False and GetBool(IAEFWksht.PrepBPTrans) == False:771 ReturnVal = GetString(IAEFWksht.DirDepRTN)772 else:773 ReturnVal = ''774def PrSavings_Calculation():775 if GetNumber(IAEFWksht.EFDDCode) != 0 and GetBool(IAEFWksht.DebitCard) == False and GetBool(IAEFWksht.PrepBPTrans) == False:776 ReturnVal = GetBool(IAEFWksht.DirDepSavings)777 else:778 ReturnVal = 0779def QnAFedBank_Calculation():780 #If GetBool(IAEFWksht.AskFedStateBank) = True Then781 # ReturnVal = 0782 #ElseIf (GetBool(IAEFWksht.DirDeposit) = True And GetCurrency(IAEFWksht.Refund) > 0) Or (GetBool(IAEFWksht.EFW) = True And GetCurrency(IAEFWksht.AmtOwed) > 0) Then783 # If GetBool(IAEFWksht.TransInfo) = True Then784 # ReturnVal = 1785 # ElseIf Trim(GetString(IAEFWksht.FedRTN)) <> "" And Trim(GetString(IAEFWksht.FedDAN)) <> "" Then786 # ReturnVal = 1787 # Else788 # ReturnVal = 0789 # End If790 #Else791 ReturnVal = 0792 #End If793def RefProdCIPInd_Calculation():794 Submission = String()795 TempStr = String()796 TempStr = GetString(IAEFWksht.EFSubmission)797 Submission = GetParam(TempStr, 1, '|')798 if GetParam(Submission, 6, ';') == '0':799 ReturnVal = '0'800 elif GetParam(Submission, 6, ';') == '1':801 if Trim(GetString(USWDebitCard.IDNumber)) != '':802 ReturnVal = '1'803 else:804 ReturnVal = '2'805 elif GetParam(Submission, 6, ';') == '3':806 ReturnVal = '0'807 elif GetParam(Submission, 6, ';') == '4':808 ReturnVal = '1'809 elif GetParam(Submission, 6, ';') == '5':810 ReturnVal = '0'811 elif GetParam(Submission, 6, ';') == '6':812 ReturnVal = '1'813 else:814 ReturnVal = '0'815def RefProdInd_Calculation():816 Submission = String()817 TempStr = String()818 TempStr = GetString(IAEFWksht.EFSubmission)819 Submission = GetParam(TempStr, 1, '|')820 if GetParam(Submission, 6, ';') == '0':821 ReturnVal = '0'822 elif GetParam(Submission, 6, ';') == '1':823 ReturnVal = '2'824 elif GetParam(Submission, 6, ';') == '2':825 ReturnVal = '0'826 elif GetParam(Submission, 6, ';') == '3':827 ReturnVal = '0'828 elif GetParam(Submission, 6, ';') == '4':829 ReturnVal = '2'830 elif GetParam(Submission, 6, ';') == '5':831 ReturnVal = '0'832 elif GetParam(Submission, 6, ';') == '6':833 ReturnVal = '2'834 else:835 ReturnVal = '0'836def Refund_Calculation():837 ReturnVal = GetCurrency(IAF1040.Refund)838def RefundDelay_Calculation():839 #this was set to 1 in 2017 will need to verify again for 2018 before shipping840 ReturnVal = 0841def RTNChange_Calculation():842 ReturnVal = GetString(IAEFWksht.DirDepRTN) + '|'843def SameFedBank_Calculation():844 SameRTN = Integer()845 SameDAN = Integer()846 SameType = Integer()847 if GetString(IAEFWksht.FedRTN) == GetString(IAEFWksht.DirDepRTN):848 SameRTN = 1849 else:850 SameRTN = 0851 if GetString(IAEFWksht.FedDAN) == GetString(IAEFWksht.DirDepDan):852 SameDAN = 1853 else:854 SameDAN = 0855 if GetBool(IAEFWksht.FedChecking) == True and GetBool(IAEFWksht.DirDepChecking) == True:856 SameType = 1857 elif GetBool(IAEFWksht.FedSavings) == True and GetBool(IAEFWksht.DirDepSavings) == True:858 SameType = 1859 else:860 SameType = 0861 if GetBool(USWBasicInfo.DirectDepY) == True and GetCurrency(USF1040.RefundOwe) > 0:862 if SameRTN + SameDAN + SameType == 3:863 ReturnVal = 1864 else:865 ReturnVal = 0866 else:867 ReturnVal = 0868def SPCombName_Calculation():869 ReturnVal = GetString(IARequired.SPCombName)870def SpSSN_Calculation():871 ReturnVal = GetString(IAF1040.SpouseSSN)872def SSN_Calculation():873 ReturnVal = GetString(IAF1040.SSN)874def StateDCReturn_Calculation():875 if GetBool(USWEFOptions.PiggyBackIA) == True or GetBool(USWEFOptions.SOIA) == True or GetBool(USWEFOptions.SOIAX) == True:876 if GetBool(IAEFWksht.DebitCard) == True and GetCurrency(IAEFWksht.Refund) > 0 and GetBool(IAEFWksht.AskDebitCard) == True:877 ReturnVal = 1878 else:879 ReturnVal = 0880 else:881 ReturnVal = 0882def TPCombName_Calculation():883 ReturnVal = GetString(IARequired.TPCombName)884def UBATrig_Calculation():885 if GetString(IAEFWksht.BankProDisCd) == '1':886 ReturnVal = 1887 elif GetString(IAEFWksht.BankProDisCd) == '2':888 ReturnVal = 1889 else:890 ReturnVal = 0891def UltDAN_Calculation():892 if GetBool(IAEFWksht.PrepBPTrans) == True:893 ReturnVal = GetString(USWRALApp.PrepBPDAN)894 else:895 ReturnVal = GetString(IAEFWksht.EFDan)896def UltRTN_Calculation():897 if GetBool(IAEFWksht.PrepBPTrans) == True:898 ReturnVal = GetString(USWRALApp.PrepBPRTN)899 else:900 ReturnVal = GetString(IAEFWksht.EFRtn)901def ViewBankInfo_Calculation():902 RefOweText = String()903 DispMethText = String()904 Routing = String()905 AcctNum = String()906 BankType = String()907 EffDate = String()908 RefOweText = ''909 DispMethText = ''910 Routing = ''911 AcctNum = ''912 BankType = ''913 EffDate = ''914 if GetCurrency(IAEFWksht.Refund) > 0:915 if GetBool(IA1040X.EFAmend) == True:916 RefOweText = 'Iowa Amended Refund'917 else:918 RefOweText = 'Iowa Refund'919 if GetBool(IAEFWksht.BP) == True:920 DispMethText = 'Republic Bank Product'921 elif GetBool(IAEFWksht.DD) == True:922 DispMethText = 'Direct Deposit'923 Routing = 'RTN: ' + GetString(IAEFWksht.EFRtn)924 AcctNum = 'Acct #: ' + GetString(IAEFWksht.EFDan)925 if GetBool(IAEFWksht.EFChecking) == True:926 BankType = 'Type: Checking'927 else:928 BankType = 'Type: Savings'929 elif GetBool(IAEFWksht.DC) == True:930 DispMethText = 'American Express Serve Card'931 else:932 DispMethText = 'Paper Check'933 ReturnVal = RefOweText + '/Refund Method: ' + DispMethText + '/' + Routing + '/' + AcctNum + '/' + BankType934 elif GetCurrency(IAEFWksht.AmtOwed) > 0:935 if GetBool(IA1040X.EFAmend) == True:936 RefOweText = 'Iowa Amended Balance Due'937 else:938 RefOweText = 'Iowa Balance Due'939 if GetBool(IAEFWksht.ACH) == True:940 DispMethText = 'Direct Withdrawal'941 Routing = 'RTN: ' + GetString(IAEFWksht.EFRtn)942 AcctNum = 'Acct #: ' + GetString(IAEFWksht.EFDan)943 if GetBool(IAEFWksht.EFChecking) == True:944 BankType = 'Type: Checking'945 else:946 BankType = 'Type: Savings'947 EffDate = 'Withdrawal Date: ' + GetVerboseDate(GetDate(IAEFWksht.EFEFWDate))948 else:949 DispMethText = 'Paper Check'950 ReturnVal = RefOweText + '/Payment Method: ' + DispMethText + '/' + Routing + '/' + AcctNum + '/' + BankType + '/' + EffDate951 else:952 if GetBool(IA1040X.EFAmend) == True:953 ReturnVal = 'Iowa: No Refund or Balance Due on Amended Return'954 else:955 ReturnVal = 'Iowa: No Refund or Balance Due'956def Yes_Calculation():957 if ( GetBool(IAEFWksht.DirDeposit) == True and GetCurrency(IAEFWksht.Refund) > 0 ) or ( GetBool(IAEFWksht.EFW) == True and GetCurrency(IAEFWksht.AmtOwed) > 0 ) :958 count = 1959 MaxAcct = GetAllCopies(USWBankAcct)960 while count <= MaxAcct:961 if GetString(USWBankAcct.BankAcct, count) != '':962 if IsStrEqual(GetString(IAEFWksht.Acct), GetString(USWBankAcct.BankAcct, count)):963 ReturnVal = GetBool(USWBankAcct.IAT, count)964 count = 99965 count = count + 1966 ReturnVal = 0967 else:...

Full Screen

Full Screen

AIBase.py

Source:AIBase.py Github

copy

Full Screen

1import gc2import math3import sys4import time5from direct.directnotify.DirectNotifyGlobal import *6from direct.interval.IntervalManager import ivalMgr7from direct.showbase import EventManager8from direct.showbase import ExceptionVarDump9from direct.showbase import PythonUtil10from direct.showbase.BulletinBoardGlobal import *11from direct.showbase.EventManagerGlobal import *12from direct.showbase.JobManagerGlobal import *13from direct.showbase.MessengerGlobal import *14from direct.showbase.PythonUtil import *15from direct.task import Task16from direct.task.TaskManagerGlobal import *17from otp.otpbase import BackupManager18from pandac.PandaModules import *19class AIBase:20 notify = directNotify.newCategory('AIBase')21 def __init__(self):22 self.config = getConfigShowbase()23 __builtins__['__dev__'] = self.config.GetBool('want-dev', 0)24 logStackDump = (self.config.GetBool('log-stack-dump', (not __dev__)) or self.config.GetBool('ai-log-stack-dump', (not __dev__)))25 uploadStackDump = self.config.GetBool('upload-stack-dump', 0)26 if logStackDump or uploadStackDump:27 ExceptionVarDump.install(logStackDump, uploadStackDump)28 if self.config.GetBool('use-vfs', 1):29 vfs = VirtualFileSystem.getGlobalPtr()30 else:31 vfs = None32 self.wantTk = self.config.GetBool('want-tk', 0)33 self.AISleep = self.config.GetFloat('ai-sleep', 0.04)34 self.AIRunningNetYield = self.config.GetBool('ai-running-net-yield', 0)35 self.AIForceSleep = self.config.GetBool('ai-force-sleep', 0)36 self.eventMgr = eventMgr37 self.messenger = messenger38 self.bboard = bulletinBoard39 self.taskMgr = taskMgr40 Task.TaskManager.taskTimerVerbose = self.config.GetBool('task-timer-verbose', 0)41 Task.TaskManager.extendedExceptions = self.config.GetBool('extended-exceptions', 0)42 self.sfxManagerList = None43 self.musicManager = None44 self.jobMgr = jobMgr45 self.hidden = NodePath('hidden')46 self.graphicsEngine = GraphicsEngine()47 globalClock = ClockObject.getGlobalClock()48 self.trueClock = TrueClock.getGlobalPtr()49 globalClock.setRealTime(self.trueClock.getShortTime())50 globalClock.setAverageFrameRateInterval(30.0)51 globalClock.tick()52 taskMgr.globalClock = globalClock53 __builtins__['ostream'] = Notify.out()54 __builtins__['globalClock'] = globalClock55 __builtins__['vfs'] = vfs56 __builtins__['hidden'] = self.hidden57 AIBase.notify.info('__dev__ == %s' % __dev__)58 PythonUtil.recordFunctorCreationStacks()59 __builtins__['wantTestObject'] = self.config.GetBool('want-test-object', 0)60 self.wantStats = self.config.GetBool('want-pstats', 0)61 Task.TaskManager.pStatsTasks = self.config.GetBool('pstats-tasks', 0)62 taskMgr.resumeFunc = PStatClient.resumeAfterPause63 defaultValue = 164 if __dev__:65 defaultValue = 066 wantFakeTextures = self.config.GetBool('want-fake-textures-ai', defaultValue)67 if wantFakeTextures:68 loadPrcFileData('aibase', 'textures-header-only 1')69 self.wantPets = self.config.GetBool('want-pets', 1)70 if self.wantPets:71 from toontown.pets import PetConstants72 self.petMoodTimescale = self.config.GetFloat('pet-mood-timescale', 1.0)73 self.petMoodDriftPeriod = self.config.GetFloat('pet-mood-drift-period', PetConstants.MoodDriftPeriod)74 self.petThinkPeriod = self.config.GetFloat('pet-think-period', PetConstants.ThinkPeriod)75 self.petMovePeriod = self.config.GetFloat('pet-move-period', PetConstants.MovePeriod)76 self.petPosBroadcastPeriod = self.config.GetFloat('pet-pos-broadcast-period', PetConstants.PosBroadcastPeriod)77 self.wantBingo = self.config.GetBool('want-fish-bingo', 1)78 self.wantKarts = self.config.GetBool('wantKarts', 1)79 self.newDBRequestGen = self.config.GetBool('new-database-request-generate', 1)80 self.waitShardDelete = self.config.GetBool('wait-shard-delete', 1)81 self.blinkTrolley = self.config.GetBool('blink-trolley', 0)82 self.fakeDistrictPopulations = self.config.GetBool('fake-district-populations', 0)83 self.wantSwitchboard = self.config.GetBool('want-switchboard', 0)84 self.wantSwitchboardHacks = self.config.GetBool('want-switchboard-hacks', 0)85 self.GEMdemoWhisperRecipientDoid = self.config.GetBool('gem-demo-whisper-recipient-doid', 0)86 self.sqlAvailable = self.config.GetBool('sql-available', 1)87 self.backups = BackupManager.BackupManager(88 filepath=self.config.GetString('backups-filepath', 'backups/'),89 extension=self.config.GetString('backups-extension', '.json'))90 self.createStats()91 self.restart()92 def setupCpuAffinities(self, minChannel):93 if process == 'uberdog':94 affinityMask = self.config.GetInt('uberdog-cpu-affinity-mask', -1)95 else:96 affinityMask = self.config.GetInt('ai-cpu-affinity-mask', -1)97 if affinityMask != -1:98 TrueClock.getGlobalPtr().setCpuAffinity(affinityMask)99 else:100 autoAffinity = self.config.GetBool('auto-single-cpu-affinity', 0)101 if process == 'uberdog':102 affinity = self.config.GetInt('uberdog-cpu-affinity', -1)103 if autoAffinity and affinity == -1:104 affinity = 2105 else:106 affinity = self.config.GetInt('ai-cpu-affinity', -1)107 if autoAffinity and affinity == -1:108 affinity = 1109 if affinity != -1:110 TrueClock.getGlobalPtr().setCpuAffinity(1 << affinity)111 elif autoAffinity:112 if process == 'uberdog':113 channelSet = int(minChannel / 1000000)114 channelSet -= 240115 affinity = channelSet + 3116 TrueClock.getGlobalPtr().setCpuAffinity(1 << affinity % 4)117 def taskManagerDoYield(self, frameStartTime, nextScheuledTaksTime):118 minFinTime = frameStartTime + self.MaxEpockSpeed119 if nextScheuledTaksTime > 0 and nextScheuledTaksTime < minFinTime:120 minFinTime = nextScheuledTaksTime121 delta = minFinTime - globalClock.getRealTime()122 while delta > 0.002:123 time.sleep(delta)124 delta = minFinTime - globalClock.getRealTime()125 def createStats(self, hostname = None, port = None):126 if not self.wantStats:127 return False128 if PStatClient.isConnected():129 PStatClient.disconnect()130 if hostname is None:131 hostname = ''132 if port is None:133 port = -1134 PStatClient.connect(hostname, port)135 return PStatClient.isConnected()136 def __sleepCycleTask(self, task):137 time.sleep(self.AISleep)138 return Task.cont139 def __resetPrevTransform(self, state):140 PandaNode.resetAllPrevTransform()141 return Task.cont142 def __ivalLoop(self, state):143 ivalMgr.step()144 return Task.cont145 def __igLoop(self, state):146 self.graphicsEngine.renderFrame()147 return Task.cont148 def shutdown(self):149 self.taskMgr.remove('ivalLoop')150 self.taskMgr.remove('igLoop')151 self.taskMgr.remove('aiSleep')152 self.eventMgr.shutdown()153 def restart(self):154 self.shutdown()155 self.taskMgr.add(self.__resetPrevTransform, 'resetPrevTransform', priority=-51)156 self.taskMgr.add(self.__ivalLoop, 'ivalLoop', priority=20)157 self.taskMgr.add(self.__igLoop, 'igLoop', priority=50)158 if self.AISleep >= 0 and (not self.AIRunningNetYield or self.AIForceSleep):159 self.taskMgr.add(self.__sleepCycleTask, 'aiSleep', priority=55)160 self.eventMgr.restart()161 def getRepository(self):162 return self.air163 def run(self):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tox automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful