refixed problem with running installed bungloo

This commit is contained in:
jeena 2013-03-04 08:17:15 +01:00
parent 0120e69429
commit 0c36523673
2 changed files with 17 additions and 16 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ dsa_priv.pem
*.pyc *.pyc
.DS_Store .DS_Store
*~ *~
Linux/build/

View file

@ -1,15 +1,15 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
import os, sys, pickle, subprocess import os, sys, pickle, subprocess, shutil
from PyQt4 import QtCore, QtGui, QtWebKit from PyQt4 import QtCore, QtGui, QtWebKit
if __name__ == "__main__": RUNNING_LOCAL = os.path.basename(__file__) == "Bungloo.py"
if RUNNING_LOCAL:
import Windows, Helper import Windows, Helper
else: else:
from bungloo import Windows, Helper from bungloo import Windows, Helper
import shutil
class Bungloo: class Bungloo:
def __init__(self): def __init__(self):
@ -29,7 +29,7 @@ class Bungloo:
self.app.exec_() self.app.exec_()
def resources_path(self): def resources_path(self):
if __name__ == '__main__': if RUNNING_LOCAL:
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) return os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
else: else:
return Helper.Helper.get_resource_path() return Helper.Helper.get_resource_path()