Page 1 of 1

paths.py and players/__init__.py contain failure code !

Posted: Wed Aug 29, 2012 12:49 pm
by BackRaw
This is just a FYI ;)

_libs/paths.py needs to read

Syntax: Select all

DATA_PATH = join(ADDON_PATH, '_libs', '_data')
instead of

Syntax: Select all

DATA_PATH = ADDON_PATH.join('_libs', '_data')
and _libs/players/__init__.py needs to read

Syntax: Select all

# Get the prop definitions file name complete with path
prop_defs_file = join(DATA_PATH, 'players', GAME_NAME + '.ini')
instead of

Syntax: Select all

# Get the prop definitions file name complete with path
prop_defs_file = DATA_PATH.join('players', GAME_NAME + '.ini')
Also, it needs to have the OS import above:

Syntax: Select all

# Python Imports
# configparser
from configparser import RawConfigParser
# OS
from os.path import join
Just to fix some errors when trying out new scripts, since these errors are very easy to fix once for all (complaining about DATA_PATH.join() takes 1 argument, 2 given, etc...) :)

Posted: Wed Aug 29, 2012 1:11 pm
by satoon101
Ummm, we added the "path" module the other day, so those are actually correct, as we don't use os.path to join anymore.

Satoon

Posted: Wed Aug 29, 2012 1:12 pm
by BackRaw
satoon101 wrote:Ummm, we added the "path" module the other day, so those are actually correct, as we don't use os.path to join anymore.

Satoon


Hhhmmmm why am I getting those errors then?

Posted: Wed Aug 29, 2012 1:15 pm
by satoon101
When you last updated, did you include ../addons/source-python/_engines/site-packages/path.py? I updated it to fix the error in join:

Syntax: Select all

# Was
def join(self, pnames):

# Changed to
def join(self, *pnames):

Changelog:
http://code.google.com/p/source-python/source/detail?r=3519892818e8460304cbe23e6ca228f21f751875

Satoon

Posted: Wed Aug 29, 2012 1:28 pm
by BackRaw
satoon101 wrote:When you last updated, did you include ../addons/source-python/_engines/site-packages/path.py? I updated it to fix the error in join:

Syntax: Select all

# Was
def join(self, pnames):

# Changed to
def join(self, *pnames):

Changelog:
http://code.google.com/p/source-python/source/detail?r=3519892818e8460304cbe23e6ca228f21f751875

Satoon


Cool, thanks. I'll look into it^^