Skip to content

Commit

Permalink
Added more windows-friendly stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
nachomonkey committed Apr 29, 2019
1 parent fd48c3d commit 4365cfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ii_game/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__myname__ = "Interplanetary Invaders"
__title__ = "Interplanetary Invaders"
__author__ = "NachoMonkey"
__version__ = "0.0.2"
__version__ = "0.0.3"
__minimum_version__ = (3, 7)
__maximum_version = (3, 8)

Expand Down
9 changes: 5 additions & 4 deletions ii_game/scripts/get_file.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
from pkg_resources import resource_filename
from ii_game.scripts.utils import fixPath
import os

DEV_RUN = os.path.abspath(".").endswith("interplanetary-invaders")

def get_file(filename):
if filename.startswith("data"):
DIR = f"{os.environ['HOME']}/.ii_game-data/"
if filename in ("data", "data/"):
DIR = fixPath(f"{os.environ['HOME']}/.ii_game-data/")
if filename in ("data", fixPath("data/")):
filename = ""
else:
filename = filename.replace("data/", "")
filename = filename.replace(fixPath("data/"), "")
if not os.path.exists(DIR):
print(f"Building personal data directory:\n{DIR}")
os.mkdir(DIR)
return DIR+filename
else:
if DEV_RUN: # Your running this as a devolper
return "ii_game/" + filename # Find it in the current directory
return fixPath("ii_game/") + filename # Find it in the current directory
return resource_filename("ii_game", filename) # Find it in the installation
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def fmt(txt):

setup(
name="ii_game",
version="0.0.2",
version="0.0.3",
author="NachoMonkey",
description="Interplanetary Invaders: Pygame-made space-invaders-esc game where you battle alien spiders across the solar system",
long_description=long_description,
Expand Down

0 comments on commit 4365cfd

Please sign in to comment.