Re: [jokosher-devel] Moving icons



Daniel Holbach wrote:
Hello everybody,

what happened to the setup.py patch I posted? It should take care of
this issue, by treating two different cases: one with a gtk icon theme
lookup (for being properly installed), the other one with relative
paths.

http://mail.gnome.org/archives/jokosher-devel-list/2006-August/msg00059.html


I never committed it back when you sent it because is was long and there wasn't much explanation to what each section of the patch was for... and I was being lazy ;). But I have now applied most of it by hand (because a lot of stuff was moved around).

Here is the rest which hasn't been applied yet, which I will commit once I fully understand. I'm not too familiar with makefiles, which you can probably tell by the makefile we use now. Mostly I just want to know why we use need to use POTFILES.in and not just run the translations merge on all *.py files? Also what happened to these two lines which grab translation template strings from the glade file and the instrument files?:

python i18nReadInstr.py ../../Instruments/*.instr > i18n.instr.h
xgettext -k_ -kN_ -o $@ ../../Jokosher.glade.h ../../*.py i18n.instr.h

BTW, the setup.py file looks pretty good :).

Laszlo


diff -ruN trunk/locale/src/Makefile jokosher/locale/src/Makefile
--- trunk/locale/src/Makefile	2006-08-04 22:46:08.000000000 +0200
+++ jokosher/locale/src/Makefile	2006-08-25 14:46:03.000000000 +0200
@@ -1,34 +1,20 @@
-#Generic rule for MO files
-%.mo: DIR1 = ../$(basename $@)
-%.mo: DIR2 = $(DIR1)/LC_MESSAGES
-%.mo: %.po
-	##############
-	#GENERATING $@
-	##############
-	if [ ! -d $(DIR1) ]; then mkdir $(DIR1); fi
-	if [ ! -d $(DIR2) ]; then mkdir $(DIR2); fi
-	msgfmt $< -o $@
-	cp $@ $(DIR2)/jokosher.mo
-
-#Generic rule for PO files
-%.po: jokosher.pot
-	##################
-	#MERGING $@ AND $<
-	##################
-	msgmerge -UN $@ $<
-
-#Generic rule for POT files
-%.pot: ../../Jokosher.glade ../../*.py ../../Instruments/*.instr
-	############
-	#CREATING $@
-	############
-	intltool-extract --type=gettext/glade ../../Jokosher.glade
-	python i18nReadInstr.py ../../Instruments/*.instr > i18n.instr.h
-	xgettext -k_ -kN_ -o $@ ../../Jokosher.glade.h ../../*.py i18n.instr.h

-update: $(shell ls *.po)
+DOMAIN=jokosher
+PO_FILES := $(wildcard *.po)

-all: $(subst .po,.mo,$(shell ls *.po))
+all: update-po

-clean:
-	rm *.mo i18n.instr.h ../../Jokosher.glade.h
\ Kein Zeilenumbruch am Dateiende.
+# update the pot
+$(DOMAIN).pot:
+	intltool-update -p -g $(DOMAIN)
+
+# merge the new stuff into the po files
+merge-po: $(PO_FILES)
+	intltool-update -r -g $(DOMAIN);
+
+# create mo from the pos
+%.mo : %.po
+	mkdir -p mo/$(subst .po,,$<)/LC_MESSAGES/
+	msgfmt $< -o mo/$(subst .po,,$<)/LC_MESSAGES/$(DOMAIN).mo
+
+update-po: $(DOMAIN).pot merge-po $(patsubst %.po,%.mo,$(wildcard *.po))	
diff -ruN trunk/locale/src/POTFILES.in jokosher/locale/src/POTFILES.in
--- trunk/locale/src/POTFILES.in	1970-01-01 01:00:00.000000000 +0100
+++ jokosher/locale/src/POTFILES.in	2006-08-25 14:55:12.000000000 +0200
@@ -0,0 +1,12 @@
+../Jokosher/AddInstrumentDialog.py
+../Jokosher/CompactMixView.py
+../Jokosher/EventLaneViewer.py
+../Jokosher/EventViewer.py
+../Jokosher/Extension.py
+../Jokosher/InstrumentConnectionsDialog.py
+../Jokosher/InstrumentViewer.py
+../Jokosher/JokosherApp.py
+../Jokosher/MasterMixerStrip.py
+../Jokosher/MixerStrip.py
+../Jokosher/NewProjectDialog.py
+../Jokosher/VUWidget.py
diff -ruN trunk/setup.py jokosher/setup.py
--- trunk/setup.py	1970-01-01 01:00:00.000000000 +0100
+++ jokosher/setup.py	2006-08-25 14:57:57.000000000 +0200
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+from distutils.core import setup
+import os
+import glob
+
+I18NFILES = []
+for filepath in glob.glob("locale/src/mo/*/LC_MESSAGES/*.mo"):
+    lang = filepath[len("locale/src/mo/"):]
+    targetpath = os.path.dirname(os.path.join("share/locale",lang))
+    I18NFILES.append((targetpath, [filepath]))
+os.system("cd locale/src; make update-po")
+
+
+setup(name='jokosher',
+      version='0.2',
+      scripts=['Jokosher/Jokosher'],
+      packages=['Jokosher'],
+      data_files=[('share/jokosher/',
+                   glob.glob("*/*.glade")
+                  ),
+                  ('share/jokosher/Instruments',
+                   glob.glob("Instruments/*.instr")
+                  ),
+                  ('share/jokosher/Instruments/images',
+                   glob.glob('Instruments/images/*')
+                  ),
+                  ('share/applications',
+                   glob.glob("*/jokosher.desktop")
+                  ),
+                  ('share/icons/hicolor/48x48/apps',
+                   ['Jokosher/jokosher-logo.png']
+                  ),
+                  ('share/pixmaps',
+                   glob.glob("images/*.png")
+                  ),
+		  ('share/applications',
+		   ['jokosher.desktop'],
+	          )
+                 ]+I18NFILES
+      )
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]