summaryrefslogtreecommitdiffstats
path: root/liveusb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'liveusb/utils.py')
-rw-r--r--liveusb/utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/liveusb/utils.py b/liveusb/utils.py
index 86ac7f6..6174fcd 100644
--- a/liveusb/utils.py
+++ b/liveusb/utils.py
@@ -100,6 +100,16 @@ def underlying_physical_device(path):
def _format_bytes_in_gb(value):
return '%0.1f GB' % (value / 10.0**9)
+def _get_datadir():
+ script_path = os.path.abspath(sys.argv[0])
+ if not script_path.startswith('/usr/'):
+ if os.path.exists('data/liveusb-creator.ui'):
+ return('data')
+ elif script_path.startswith('/usr/local/'):
+ return('/usr/local/share/liveusb-creator')
+ else:
+ return('/usr/share/liveusb-creator')
+
def get_open_write_fd(block):
(fd_index, fd_list) = block.call_open_for_restore_sync(
arg_options=GLib.Variant('a{sv}', None)