From 5d2bdc16aa26145fa60d04b13b7e98343d9890ab Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 30 Sep 2013 21:53:47 +0300 Subject: [PATCH] Gui tool works when installed now. --- install_meson.py | 7 +++++-- mesongui.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/install_meson.py b/install_meson.py index a4535ea41..1b691d58a 100755 --- a/install_meson.py +++ b/install_meson.py @@ -50,13 +50,15 @@ else: script_dir = os.path.join(install_root, 'share/meson-' + version) bin_dir = os.path.join(install_root, 'bin') bin_script = os.path.join(script_dir, 'meson.py') +gui_script = os.path.join(script_dir, 'mesongui.py') bin_name = os.path.join(bin_dir, 'meson') +gui_name = os.path.join(bin_dir, 'mesongui') man_dir = os.path.join(install_root, 'share/man/man1') in_manfile = 'man/meson.1' out_manfile = os.path.join(man_dir, 'meson.1.gz') symlink_value = os.path.relpath(bin_script, os.path.dirname(bin_name)) - +guisymlink_value = os.path.relpath(gui_script, os.path.dirname(gui_name)) files = glob.glob('*.py') files += glob.glob('*.ui') @@ -77,7 +79,8 @@ try: os.remove(bin_name) except OSError: pass -print('Creating symlink %s.' % bin_name) +print('Creating symlinks %s and %s.' % (bin_name, gui_name)) os.symlink(symlink_value, bin_name) +os.symlink(guisymlink_value, gui_name) print('Installing manfile to %s.' % man_dir) open(out_manfile, 'wb').write(gzip.compress(open(in_manfile, 'rb').read())) diff --git a/mesongui.py b/mesongui.py index 92580e0fd..f49a8a580 100755 --- a/mesongui.py +++ b/mesongui.py @@ -23,7 +23,7 @@ from PyQt5.QtCore import QAbstractItemModel, QModelIndex, QVariant, QTimer import PyQt5.QtCore import PyQt5.QtWidgets -priv_dir = os.path.split(os.path.abspath(__file__))[0] +priv_dir = os.path.split(os.path.abspath(os.path.realpath(__file__)))[0] class PathModel(QAbstractItemModel): def __init__(self, coredata): @@ -318,7 +318,7 @@ class MesonGui(): self.coredata_file = os.path.join(build_dir, 'meson-private/coredata.dat') self.build_file = os.path.join(build_dir, 'meson-private/build.dat') if not os.path.exists(self.coredata_file): - printf("Argument is not build directory.") + print("Argument is not build directory.") sys.exit(1) self.coredata = pickle.load(open(self.coredata_file, 'rb')) self.build = pickle.load(open(self.build_file, 'rb'))