Ryochan7 / sc-controller

User-mode driver and GTK3 based GUI for Steam Controller
GNU General Public License v2.0
176 stars 23 forks source link

Cannot import Steam Profiles #37

Closed TheLux83 closed 2 years ago

TheLux83 commented 3 years ago

Hey there,

I wanted to try to import my Steam Controller configs to SC-Controller, but I get the following error message:

local variable 'vdfpath' referenced before assignment
Traceback (most recent call last):
  File "/home/the_lux/git/sc-controller/scc/gui/importexport/import_vdf.py", line 375, in import_vdf
    self._profile.load(filename)
  File "/home/the_lux/git/sc-controller/scc/foreign/vdf.py", line 597, in load
    data = parse_vdf(open(filename, "r"))
  File "/home/the_lux/git/sc-controller/scc/lib/vdf.py", line 32, in parse_vdf
    if not vdfpath:
UnboundLocalError: local variable 'vdfpath' referenced before assignment

Profile filename: /home/the_lux/.local/share/Steam/userdata/10609250/241100/remote/2458639198_controller_config.vdf

I get this error, when I clone the repository and start ./run.sh When I use the AppImage, I don't get any error message at all.

Can someone help me?

Supreeeme commented 3 years ago

This might be a dependency issue. Do you have python-vdf installed? Forgot to add that to the dependencies. Also probably not checking for the package correctly.

If you're running Arch, there's an AUR package for it.

TheLux83 commented 3 years ago

Hey Supreeeme. It seems that this was the issue. I've installed python-vdf via pip with pip install vdf and now it works.

I'm using Manjaro, but when I install the AUR package, I had the same error message. So I needed to install python-vdf here as well.

But now it seems to be running well :-) Thanks for your help!

Ryochan7 commented 3 years ago

SC Controller comes with its own VDF file reader utils so python-vdf should not be necessary. I don't have that python package installed on my Fedora system. Granted, I have not tried the latest changes that fix importing Steam profiles yet.

Ryochan7 commented 3 years ago

The VDF reader utils works fine on my end with the latest fix. Installing python-vdf should not be necessary.

carloscheddar commented 3 years ago

Fixed for me after installing python-vdf. I'm using Arch and installed sc-controller via AUR using yay.

Ryochan7 commented 3 years ago

I have to check the AppImage and see if the build script needs to be updated. The README was updated before the last release to list python-vdf as a dependency.

Ryochan7 commented 3 years ago

Importing Steam profiles does not work in the current AppImage. I will re-open this issue until that problem is fixed.

Ryochan7 commented 3 years ago

Found a couple more issues with VDF importing. Got them fixed in commit f67249c90adeb09563e620f3c66d7f0b180e6f40. I won't worry about closing this issue again until the next public release.

EPecherkin commented 2 years ago

Hello @Ryochan7 First of all - thank you for your work on this tool

It seems that this feature doesn't work again I installed the latest version of SC-Controller from AUR When I tried to import a profile - it did nothing. So, I installed python-vdf. Now, it fails with

Unknown button: 'button_a'
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/scc/gui/importexport/import_vdf.py", line 379, in import_vdf
    self._profile.load(filename)
Ryochan7 commented 2 years ago

I guess older VDF profiles might have used aliases like button_a in profiles rather than button_A like I see in current VDF files on my system. Better add those aliases back in.

Ryochan7 commented 2 years ago

Should be fixed in commit 03ea18529e5f751af871f5d5b01c72f408b80361