[meld] Add build_helpers module, with modified material from DistUtilsExtra
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Add build_helpers module, with modified material from DistUtilsExtra
- Date: Sat, 9 Nov 2013 21:58:47 +0000 (UTC)
commit cea6c1f6bab2897741c8a4f1882e1eab8f18a5f4
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue Nov 5 07:33:16 2013 +1000
Add build_helpers module, with modified material from DistUtilsExtra
meld/build_helpers.py | 37 +++++++++++++++++++++++++++++++++++++
setup.py | 6 ++++--
2 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/meld/build_helpers.py b/meld/build_helpers.py
new file mode 100644
index 0000000..554affc
--- /dev/null
+++ b/meld/build_helpers.py
@@ -0,0 +1,37 @@
+# Created by Sebastian Heinlein
+# Modified by Kai Willadsen
+
+import distutils
+import glob
+import os
+import os.path
+import distutils.command.build
+
+
+class build_icons(distutils.cmd.Command):
+
+ icon_dir = os.path.join("data","icons")
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ data_files = self.distribution.data_files
+
+ for theme in glob.glob(os.path.join(self.icon_dir, "*")):
+ for size in glob.glob(os.path.join(theme, "*")):
+ for category in glob.glob(os.path.join(size, "*")):
+ icons = []
+ for icon in glob.glob(os.path.join(category,"*")):
+ if not os.path.islink(icon):
+ icons.append(icon)
+ if not icons:
+ continue
+ data_files.append(("share/icons/%s/%s/%s" %
+ (os.path.basename(theme),
+ os.path.basename(size),
+ os.path.basename(category)),
+ icons))
diff --git a/setup.py b/setup.py
index 983e94e..6b8aa24 100644
--- a/setup.py
+++ b/setup.py
@@ -4,10 +4,12 @@ from distutils.core import setup
import glob
from DistUtilsExtra.command import (
- build_extra, build_i18n, build_help, build_icons)
+ build_extra, build_i18n, build_help)
import meld.conf
+from meld.build_helpers import build_icons
+
setup(
name=meld.conf.__package__,
@@ -46,6 +48,6 @@ setup(
"build": build_extra.build_extra,
"build_i18n": build_i18n.build_i18n,
"build_help": build_help.build_help,
- "build_icons": build_icons.build_icons,
+ "build_icons": build_icons,
}
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]