Skip to content

Commit

Permalink
[fix] only dbs and activities are supported in h
Browse files Browse the repository at this point in the history
in history, when the type of object was not db, it was treated always as
an activity, but other new types of objects have been added to the
history now.
method, category and subcategory history entries are now correctly
processed

close #13
  • Loading branch information
tngTUDOR committed Feb 21, 2024
1 parent a6bdac5 commit fac6515
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ui Changelog

## [0.33.0]

### Fixed

+ issue #13 : history works fine

## [0.31.1]

Minor bump to fix pipelines.
Expand Down
10 changes: 9 additions & 1 deletion bw2ui/bin/bw2_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ def choose_option(self, opt):
self.choose_database(option[1])
elif option[0] == "activity":
self.choose_activity(option[1])
elif option[0] == "method":
self.choose_method(option[1])
elif option[0] == "category":
self.choose_category(option[1])
elif option[0] == "subcategory":
self.choose_subcategory(option[1])
else:
# No current options.
print("No current options to choose from")
Expand Down Expand Up @@ -333,8 +339,10 @@ def format_history(self, command):
kind, obj = command
if kind == "database":
return "Db: %(name)s" % {"name": obj}
else:
elif kind == "activity":
return "Act: %(act)s" % {"act": self.format_activity(obj)}
else:
return f"{kind}: {obj}"

def reformat_history(self, json_data):
"""Convert lists to tuples (from JSON serialization)"""
Expand Down

0 comments on commit fac6515

Please sign in to comment.