MilhouseVH / texturecache.py

Utility script to manage the XBMC texture cache
http://forum.xbmc.org/showthread.php?tid=158373
GNU General Public License v2.0
181 stars 34 forks source link

version 1.8.1 throws error upon vscan #24

Closed graysky2 closed 10 years ago

graysky2 commented 10 years ago

1.7.9 works fine, but 1.8.1 throws these error on Arch linux i686:

% texturecache vscan
teTraceback (most recent call last):
  File "/usr/lib/python3.4/configparser.py", line 762, in get
    value = d[option]
  File "/usr/lib/python3.4/collections/__init__.py", line 790, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "/usr/lib/python3.4/collections/__init__.py", line 782, in __missing__
    raise KeyError(key)
KeyError: 'userdata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/texturecache", line 499, in getValue
    value = config.get(self.THIS_SECTION, aKey)
  File "/usr/lib/python3.4/configparser.py", line 765, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'userdata' in section: 'global'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/texturecache", line 7552, in <module>
    main(sys.argv[1:])
  File "/usr/bin/texturecache", line 7259, in main
    loadConfig(argv)
  File "/usr/bin/texturecache", line 6852, in loadConfig
    gConfig = MyConfiguration(argv)
  File "/usr/bin/texturecache", line 168, in __init__
    self.XBMC_BASE = os.path.expanduser(self.getValue(config, "userdata", UD_SYS_DEFAULT))
  File "/usr/bin/texturecache", line 512, in getValue
    if default is None and not allowNone:
NameError: name 'allowNone' is not defined
MilhouseVH commented 10 years ago

What's the path for the userdata folder on your system?

It looks like it just needs a sane default, even if it doesn't exist (it's not required for all options, particularly JSON-based options).

graysky2 commented 10 years ago

/var/lib/xbmc/.xbmc/userdata

MilhouseVH commented 10 years ago

Is that the standard for Arch?

Any idea what it is after the Kodi rebranding, is it:

/var/lib/kodi/.kodi/userdata

as trying to accommodate both .kodi and .xbmc is what has broken userdata... :)

graysky2 commented 10 years ago

That's the Arch standard for those wanting a standalone setup (i.e. not running from an existing user/X-session). No idea about the future post rename. Likely, yes.

MilhouseVH commented 10 years ago

Can you try this version: http://pastebin.com/raw.php?i=0kNXAA6r

It should hopefully find your default userdata (either xbmc/.xbmc or kodi/.kodi etc.). Confirm with:

./texturecache.py config | grep userdata

In the event that no userdata folder can be found, it will just use "~/userdata" - previously it was trying to use None hence the blowup.

graysky2 commented 10 years ago

Works... surprised you didn't commit to unstable!

% ./try config | grep userdata
  userdata = /var/lib/xbmc/.xbmc/userdata/ 
MilhouseVH commented 10 years ago

Many thanks - new version pushed.

graysky2 commented 10 years ago

Thanks for the quick turnaround and for developing this excellent swiss army knife of a script.