Skip to content

Commit

Permalink
Fixed binary issue where preferences images weren't loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Blumberg committed Nov 7, 2019
1 parent d1423f4 commit 19b12b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sharppy/viz/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import numpy as np

import os
import sys

def resource_path():
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, "rc")
return os.path.join(os.path.dirname(__file__), "..", "..", "rc")

class ColorSwatch(QWidget):
"""
Expand Down Expand Up @@ -83,7 +89,7 @@ class ColorPreview(QWidget):

def __init__(self, styles, default='standard', **kwargs):
super(ColorPreview, self).__init__(**kwargs)
self._img_path = os.path.join(os.path.dirname(__file__), "..", "..", "rc")
self._img_path = resource_path() #os.path.join(os.path.dirname(__file__), "..", "..", "rc")
self._styles = [ s.lower() for s in styles ]
self.changeImage(self._styles.index(default))

Expand Down

0 comments on commit 19b12b4

Please sign in to comment.