Skip to content

Commit

Permalink
Prettify dictionary keys
Browse files Browse the repository at this point in the history
  • Loading branch information
sajith committed Oct 18, 2023
1 parent 5b460a6 commit 2c9d5dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fabrictestbed_extensions/fablib/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,15 @@ def site_to_dict(
}
if not latlon:
d.pop("location")

# Prettify the dict's keys so that `fields` and
# `filter_function` arguments to list_sites() will work.
for k, v in d.items():
pretty_key = self.site_pretty_names.get(k)
if not pretty_key:
continue
d[pretty_key] = d.pop(k)

return d

def site_to_dictXXX(self, site):
Expand Down

0 comments on commit 2c9d5dc

Please sign in to comment.