[gcompris/gcomprixogoo] Created a new script utility. It create a new empty activity with the given name (only python activi
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris/gcomprixogoo] Created a new script utility. It create a new empty activity with the given name (only python activi
- Date: Sun, 4 Jul 2010 22:27:13 +0000 (UTC)
commit 225adc6c1c3ae817277ba8e2e35672872aff86d4
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Mon Jul 5 00:23:31 2010 +0200
Created a new script utility. It create a new empty activity with
the given name (only python activity).
src/createit.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/src/createit.sh b/src/createit.sh
new file mode 100755
index 0000000..4989f0b
--- /dev/null
+++ b/src/createit.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+#set -x
+if [ -z $1 ]; then
+ echo "Usage: createit.sh [new GCompris activity]"
+ echo " e.g.: createit.sh myactivity"
+ exit 1
+fi
+
+activity=$1
+activitydir=$1-activity
+
+template=pythontemplate
+templatedir=pythontemplate-activity
+
+path=`dirname $0`
+
+cp -r $templatedir $activitydir
+cp newactivity.svg $activitydir/$activity.svg
+cd $activitydir
+
+# Cleanup, remove generated files
+rm -f Makefile pythontemplate.pyc pythontemplate.xml \
+ Makefile Makefile.in python.svg
+
+mv $template.py $activity.py
+mv $template.xml.in $activity.xml.in
+
+sed -i s/$template/$activity/g init_path.sh Makefile.am \
+ $activity.xml.in $activity.py
+
+sed -i s/python.svg/$activity.svg/ $activity.xml.in Makefile.am
+
+sed -i "s:Bruno Coudoin:your name here:" $activity.xml.in
+sed -i "s:\\(<_title>.*</_title>\\):<_title>set a title for $activity</_title>:" $activity.xml.in
+sed -i "s:\\(<_description>.*</_description>\\):<_description>set a description for $activity</_description>:" $activity.xml.in
+sed -i "s:\\(<_prerequisite>.*</_prerequisite>\\):<_prerequisite>set a prerequisite for $activity</_prerequisite>:" $activity.xml.in
+sed -i "s:\\(<_goal>.*</_goal>\\):<_goal>set a goal for $activity</_goal>:" $activity.xml.in
+sed -i "s:\\(<_manual>.*</_manual>\\):<_manual>set a manual for $activity</_manual>:" $activity.xml.in
+sed -i "s:\\(<_credit>.*</_credit>\\):<_credit>set a credit for $activity</_credit>:" $activity.xml.in
+
+cd -
+
+# Now add the activity to our compilation chain
+sed -i "s:\\(AC_OUTPUT.*\\):\\1 src/$activitydir/Makefile:" ../configure.ac
+sed -i "s:SUBDIRS = :SUBDIRS = $activitydir :" Makefile.am
+echo src/$activitydir/$activity.xml.in >> ../po/POTFILES.in
+echo src/$activitydir/$activity.py >> ../po/POTFILES.in
+
+echo "Now you can test your activity with:"
+echo "make && ./runit $activitydir"
+echo "To run it in a complete GCompris, run:"
+echo "sudo make install"
+echo "gcompris --experimental"
+echo "(by default the activity is in the experimental section."
+echo " To change is, edit the file $activitydir/$activity.xml.in"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]