aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson/mesonmain.ui (renamed from mesonmain.ui)0
-rw-r--r--meson/mesonrunner.ui (renamed from mesonrunner.ui)0
-rw-r--r--meson/mesonstart.ui (renamed from mesonstart.ui)0
-rw-r--r--meson/mgui.py (renamed from mesongui.py)26
-rw-r--r--meson/mintro.py (renamed from mesonintrospect.py)16
-rwxr-xr-xmesongui20
-rwxr-xr-xmesonintrospect20
7 files changed, 65 insertions, 17 deletions
diff --git a/mesonmain.ui b/meson/mesonmain.ui
index 209584b..209584b 100644
--- a/mesonmain.ui
+++ b/meson/mesonmain.ui
diff --git a/mesonrunner.ui b/meson/mesonrunner.ui
index 942c6bd..942c6bd 100644
--- a/mesonrunner.ui
+++ b/meson/mesonrunner.ui
diff --git a/mesonstart.ui b/meson/mesonstart.ui
index c6c5f96..c6c5f96 100644
--- a/mesonstart.ui
+++ b/meson/mesonstart.ui
diff --git a/mesongui.py b/meson/mgui.py
index bdd44bb..6e57ce7 100644
--- a/mesongui.py
+++ b/meson/mgui.py
@@ -15,7 +15,7 @@
# limitations under the License.
import sys, os, pickle, time, shutil
-import build, coredata, environment, mesonlib
+from . import build, coredata, environment, mesonlib
from PyQt5 import uic
from PyQt5.QtWidgets import QApplication, QMainWindow, QHeaderView
from PyQt5.QtWidgets import QComboBox, QCheckBox
@@ -242,23 +242,23 @@ class OptionForm:
combo.addItem('debug')
combo.addItem('debugoptimized')
combo.addItem('release')
- combo.setCurrentText(self.coredata.buildtype)
+ combo.setCurrentText(self.coredata.get_builtin_option('buildtype'))
combo.currentTextChanged.connect(self.build_type_changed)
self.form.addRow('Build type', combo)
strip = QCheckBox("")
- strip.setChecked(self.coredata.strip)
+ strip.setChecked(self.coredata.get_builtin_option('strip'))
strip.stateChanged.connect(self.strip_changed)
self.form.addRow('Strip on install', strip)
coverage = QCheckBox("")
- coverage.setChecked(self.coredata.coverage)
+ coverage.setChecked(self.coredata.get_builtin_option('coverage'))
coverage.stateChanged.connect(self.coverage_changed)
self.form.addRow('Enable coverage', coverage)
pch = QCheckBox("")
- pch.setChecked(self.coredata.use_pch)
+ pch.setChecked(self.coredata.get_builtin_option('use_pch'))
pch.stateChanged.connect(self.pch_changed)
self.form.addRow('Enable pch', pch)
unity = QCheckBox("")
- unity.setChecked(self.coredata.unity)
+ unity.setChecked(self.coredata.get_builtin_option('unity'))
unity.stateChanged.connect(self.unity_changed)
self.form.addRow('Unity build', unity)
form.addRow(PyQt5.QtWidgets.QLabel("Project options"))
@@ -545,17 +545,21 @@ class MesonGuiRespawner():
self.gui.resize(s)
# Garbage collection takes care of the old gui widget
-if __name__ == '__main__':
+
+def run(args): # SPECIAL, Qt wants all args, including command name.
app = QApplication(sys.argv)
- if len(sys.argv) == 1:
+ if len(args) == 1:
arg = ""
- elif len(sys.argv) == 2:
+ elif len(args) == 2:
arg = sys.argv[1]
else:
print(sys.argv[0], "<build or source dir>")
- sys.exit(1)
+ return 1
if os.path.exists(os.path.join(arg, 'meson-private/coredata.dat')):
guirespawner = MesonGuiRespawner(arg)
else:
runner = Starter(arg)
- sys.exit(app.exec_())
+ return app.exec_()
+
+if __name__ == '__main__':
+ sys.exit(run(sys.argv))
diff --git a/mesonintrospect.py b/meson/mintro.py
index 9fcd4db..b088117 100644
--- a/mesonintrospect.py
+++ b/meson/mintro.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-# Copyright 2014-2015 The Meson development team
+# Copyright 2014-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ Currently only works for the Ninja backend. Others use generated
project files and don't need this info."""
import json, pickle
-import coredata, build, mesonlib
+from . import coredata, build, mesonlib
import argparse
import sys, os
@@ -172,11 +172,11 @@ def list_tests(testdata):
result.append(to)
print(json.dumps(result))
-if __name__ == '__main__':
- options = parser.parse_args()
+def run(args):
+ options = parser.parse_args(args)
if len(options.args) > 1:
print('Too many arguments')
- sys.exit(1)
+ return 1
elif len(options.args) == 1:
bdir = options.args[0]
else:
@@ -205,4 +205,8 @@ if __name__ == '__main__':
list_deps(coredata)
else:
print('No command specified')
- sys.exit(1)
+ return 1
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(run(sys.argv[1:]))
diff --git a/mesongui b/mesongui
new file mode 100755
index 0000000..c1cd802
--- /dev/null
+++ b/mesongui
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+
+# Copyright 2016 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from meson import mgui
+import sys
+
+sys.exit(mgui.run(sys.argv))
diff --git a/mesonintrospect b/mesonintrospect
new file mode 100755
index 0000000..94c05ea
--- /dev/null
+++ b/mesonintrospect
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+
+# Copyright 2016 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from meson import mintro
+import sys
+
+sys.exit(mintro.run(sys.argv[1:]))