Skip to content

Commit

Permalink
allow running from context of another directory
Browse files Browse the repository at this point in the history
  • Loading branch information
emendir committed Dec 4, 2023
1 parent e0b431f commit 3c2fcb5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def QR_Decoder(image):
return {"image": image, "type": obj.type, "data": obj.data}


if os.path.exists('ScanGen.ui'):
abs_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)))
if os.path.exists(os.path.join(abs_dir, 'ScanGen.ui')):
os.chdir(abs_dir)
Ui_MainWindow, QMainWindow = loadUiType('ScanGen.ui')
else:
from ScanGen import Ui_MainWindow
Expand Down

0 comments on commit 3c2fcb5

Please sign in to comment.