ivnvxd/arc-export

[Bug] Traceback when trying to run main.py

Closed this issue · 1 comments

╭─anthony@Anthonys-MacBook-Pro ~/Documents/arcexport
╰─$ curl -o main.py https://raw.githubusercontent.com/ivnvxd/arc-export/main/main.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5793  100  5793    0     0  15731      0 --:--:-- --:--:-- --:--:-- 15699
╭─anthony@Anthonys-MacBook-Pro ~/Documents/arcexport
╰─$ python3 main.py
Reading JSON...
> Found StorableSidebar.json in Library directory.
Getting spaces...
Traceback (most recent call last):
  File "/Users/anthony/Documents/arcexport/main.py", line 185, in <module>
    main()
  File "/Users/anthony/Documents/arcexport/main.py", line 8, in main
    html: str = convert_json_to_html(data)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anthony/Documents/arcexport/main.py", line 51, in convert_json_to_html
    spaces: dict = get_spaces(json_data["sidebar"]["containers"][target]["spaces"])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anthony/Documents/arcexport/main.py", line 80, in get_spaces
    spaces_names["pinned"][containers[i + 1]]: str = title
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
TypeError: unhashable type: ‘dict'

Fixed it myself by changing these two lines:

Line 80: spaces_names["pinned"][containers[i + 1]]: str = title
Line 82: spaces_names["unpinned"][containers[i + 1]]: str = title

To this:

spaces_names["pinned"][str(containers[i + 1])] = title
And:
spaces_names["unpinned"][str(containers[i + 1])] = title