Skip to content

Commit 8cc0f20

Browse files
committed
Changed how the second Account stuff happens a bit. Still has a hack
in it I'd like to clean up though...
1 parent fa09e05 commit 8cc0f20

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lia.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,26 @@ def mainAccountPrompt(lineData, importAccount = ""):
6060
def secondAccountsPrompt(lineData, ruleList=False):
6161
"""Prompts the user for the secondary account(s) information"""
6262
secondAccounts = []
63-
accountAdd = True
63+
6464
if(ruleList):
6565
prefill = rules.matchRuleData(lineData, ruleList)
6666
else:
6767
prefill = ""
6868

69-
while(accountAdd or secondAccounts == []):
70-
if(not(accountAdd) and secondAccounts == []):
71-
print("At least one secondary account must be specified. Try again.")
72-
accountAdd = getUserInput("Secondary account(s): ", prefill = prefill)
73-
if(accountAdd):
74-
prefill = ""
69+
force = True
70+
accountAmount = True ## Ugh this is such a hack...
71+
while(accountAmount != ""):
72+
accountAmount = ""
73+
accountAdd = getUserInput("Secondary account(s): ", prefill = prefill, defaultValue = "", force= force)
74+
if(accountAdd != ""):
7575
accountAmount = getUserInput("'" + accountAdd + "'" + " amount: ", defaultValue = "")
7676
secondAccounts.append((accountAdd, accountAmount))
77+
force = False
78+
7779
return(backend.setSecondAccounts(lineData, secondAccounts))
7880

81+
82+
7983
def cacheProcess(queueData,ruleList, importAccount, outputFile, cacheFileSRC):
8084
"""CLI for processing input files or cached items"""
8185
for i in range(0,len(queueData)):

0 commit comments

Comments
 (0)