use executable location for local path, not Utils location. As it may be elsewhere.

This commit is contained in:
Fabian Dill 2020-03-02 23:27:16 +01:00
parent f5bc54976c
commit 80fa9f4c58
1 changed files with 2 additions and 3 deletions

View File

@ -30,8 +30,7 @@ def snes_to_pc(value):
return ((value & 0x7F0000)>>1)|(value & 0x7FFF) return ((value & 0x7F0000)>>1)|(value & 0x7FFF)
def parse_player_names(names, players, teams): def parse_player_names(names, players, teams):
names = (n.strip() for n in names.split(",")) names = tuple(n for n in (n.strip() for n in names.split(",")) if n)
names = tuple(filter(bool, names))
ret = [] ret = []
while names or len(ret) < teams: while names or len(ret) < teams:
team = [n[:16] for n in names[:players]] team = [n[:16] for n in names[:players]]
@ -58,7 +57,7 @@ def local_path(path):
local_path.cached_path = os.path.dirname(sys.argv[0]) local_path.cached_path = os.path.dirname(sys.argv[0])
else: else:
# we are running in a normal Python environment # we are running in a normal Python environment
local_path.cached_path = os.path.dirname(os.path.abspath(__file__)) local_path.cached_path = os.path.dirname(os.path.abspath(sys.argv[0]))
return os.path.join(local_path.cached_path, path) return os.path.join(local_path.cached_path, path)
local_path.cached_path = None local_path.cached_path = None