From 66c5ab7aa966eaac2a1e5ec9425d41b3b6e2c572 Mon Sep 17 00:00:00 2001
From: Giorgos Korfiatis <gkorf@grnet.gr>
Date: Mon, 4 May 2015 15:25:26 +0300
Subject: [PATCH] Don't assume current path when getting file

---
 agkyra/agkyra/gui.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/agkyra/agkyra/gui.py b/agkyra/agkyra/gui.py
index 25c6804..557ff74 100644
--- a/agkyra/agkyra/gui.py
+++ b/agkyra/agkyra/gui.py
@@ -7,12 +7,13 @@ from ws4py.client import WebSocketBaseClient
 from tempfile import NamedTemporaryFile
 import subprocess
 import json
-from os.path import abspath
+from os.path import abspath, join
 from threading import Thread
 from hashlib import sha1
 import os
 import logging
 
+CURPATH = os.path.dirname(os.path.abspath(__file__))
 
 LOG = logging.getLogger(__name__)
 
@@ -40,8 +41,8 @@ class GUI(WebSocketBaseClient):
         # subprocess.call blocks the execution
         LOG.debug('RUN: %s' % (fp.name))
         subprocess.call([
-            abspath('agkyra/nwjs/nw'),
-            abspath('agkyra/gui.nw'),
+            os.path.join(os.path.join(CURPATH, 'nwjs'), 'nw'),
+            os.path.join(CURPATH, 'gui.nw'),
             fp.name,
             '--data-path', abspath('~/.agkyra')])
         LOG.debug('GUI process closed, remove temp file')
-- 
GitLab