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

All other Source.Python topics and issues.
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

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

Postby BackRaw » Wed Aug 29, 2012 12:49 pm

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...) :)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Aug 29, 2012 1:11 pm

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
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Wed Aug 29, 2012 1:12 pm

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?
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Aug 29, 2012 1:15 pm

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
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Wed Aug 29, 2012 1:28 pm

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^^

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 50 guests