Skip to content

Commit

Permalink
Merge pull request #384 from mpmc/next_release
Browse files Browse the repository at this point in the history
Improve getAllInputs
  • Loading branch information
jarvisteach committed Feb 16, 2018
2 parents 4c1d574 + 12c9002 commit 9334e85
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions appJar/appjar.py
Expand Up @@ -9701,15 +9701,17 @@ def getAllInputs(self, **kwargs):
self.getAllDatePickers(),
kwargs,
])
result = dict()
result = data = dict()
for pairs in inputs:
# Remove pairs with empty values (anything that doesn't
# equal True).
data = {key: val for key, val in pairs.items() if val}
# Only add the pair if they don't already exist.
for key, val in data.items():
for key, val in pairs.items():
# Try and strip values.
try:
if result[key]:
val = val.strip()
except AttributeError:
pass
try:
# Skip if value is empty or if key already exists.
if not val or result[key]:
continue
except KeyError:
pass
Expand Down

0 comments on commit 9334e85

Please sign in to comment.