[gtk-mac-bundler] Make the launcher_script element behave the way described in the example bundle.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-mac-bundler] Make the launcher_script element behave the way described in the example bundle.
- Date: Tue, 16 Aug 2016 19:09:08 +0000 (UTC)
commit a3bd48d83a3dce4e47dfefb23bf3f49e17cdc75e
Author: John Ralls <jralls ceridwen us>
Date: Sat Aug 13 17:56:46 2016 -0700
Make the launcher_script element behave the way described in the example bundle.
bundler/project.py | 15 +++++++++------
bundler/utils.py | 2 ++
2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/bundler/project.py b/bundler/project.py
index 60f0541..c130f97 100644
--- a/bundler/project.py
+++ b/bundler/project.py
@@ -324,13 +324,16 @@ class Project:
node = utils.node_get_element_by_tag_name(self.root, "launcher-script")
if node:
path = Path.from_node(node, False)
- path.dest = "${bundle}/Contents/MacOS/${name}"
- else:
- # Use the default launcher.
- launcher = os.path.join(os.path.dirname(__file__), "launcher.sh")
- path = Path(launcher, "${bundle}/Contents/MacOS/${name}")
+ if not path.source:
+ # Use the default launcher.
+ launcher = os.path.join(os.path.dirname(__file__),
+ "launcher.sh")
+ path = Path(launcher, "${bundle}/Contents/MacOS/${name}")
+ else:
+ path.dest = "${bundle}/Contents/MacOS/${name}"
+ return path
- return path
+ return None
def get_icon_themes(self):
themes = []
diff --git a/bundler/utils.py b/bundler/utils.py
index 76c83d1..62b5140 100644
--- a/bundler/utils.py
+++ b/bundler/utils.py
@@ -78,6 +78,8 @@ def node_get_element_by_tag_name(node, name):
def node_get_string(node, default=None):
try:
+ if node.firstChild == None:
+ return None
return node.firstChild.data.strip()
except:
return default
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]