2021-03-12 04:17:19 +00:00
|
|
|
# Authors: see git history
|
|
|
|
#
|
|
|
|
# Copyright (c) 2010 Authors
|
|
|
|
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
|
|
|
|
|
2021-03-04 17:40:53 +00:00
|
|
|
import sys
|
|
|
|
from os.path import isfile, join, realpath
|
|
|
|
|
|
|
|
from ..i18n import _
|
|
|
|
|
|
|
|
|
|
|
|
def get_inkstitch_version():
|
|
|
|
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
2021-12-08 21:18:41 +00:00
|
|
|
if sys.platform == "darwin":
|
|
|
|
version = realpath(join(sys._MEIPASS, "..", 'Resources', "VERSION"))
|
|
|
|
else:
|
|
|
|
version = realpath(join(sys._MEIPASS, "..", "VERSION"))
|
2021-03-04 17:40:53 +00:00
|
|
|
else:
|
|
|
|
version = realpath(join(realpath(__file__), "..", "..", "..", 'VERSION'))
|
|
|
|
if isfile(version):
|
|
|
|
with open(version, 'r') as v:
|
|
|
|
inkstitch_version = _("Ink/Stitch Version: %s") % v.readline()
|
|
|
|
else:
|
2021-07-29 18:52:44 +00:00
|
|
|
inkstitch_version = _("Ink/Stitch Version: unknown")
|
2021-03-04 17:40:53 +00:00
|
|
|
return inkstitch_version
|