Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 6, 2017
1 parent bcca7af commit 4160e19
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from builtins import zip
import os


def setupenv():
"""
Set the environment for Windows based on the .vars files from the
Expand All @@ -41,14 +42,18 @@ def setupenv():
path_split = PurePath(os.path.dirname(os.path.realpath(__file__))).parts

try:
appname = os.environ['QGIS_ENVNAME']
appname = os.environ['QGIS_ENVNAME']
except KeyError:
appname = path_split[-3]

envfile= list(path_split[:-4])
envfile = list(path_split[:-4])
envfile.append("bin")
envfile.append("{0}-bin.env".format(appname))
envfile = os.path.join(*envfile)

if not os.path.exists(envfile):
return

with open(envfile) as f:
for line in f:
linedata = line.split("=")
Expand Down

0 comments on commit 4160e19

Please sign in to comment.