[sword-svn] r124 - in trunk: . lessons micro/src/org/crosswire/flashcards

Apache apache at www.crosswire.org
Wed Nov 7 20:43:50 MST 2007


Author: 
Date: 2007-11-07 20:43:50 -0700 (Wed, 07 Nov 2007)
New Revision: 124

Added:
   trunk/lessons/greekBlack/
   trunk/lessons/greekMounce/
   trunk/lessons/greekMounceFreq/
   trunk/lessons/greekParsing/
   trunk/lessons/hebrewParsing/
   trunk/lessons/hebrewWegner/
   trunk/lessons/hebrewWegner2/
Removed:
   trunk/lessons/GreekParsing/
   trunk/lessons/HebrewParsing/
   trunk/lessons/HebrewWegner/
   trunk/lessons/HebrewWegner2/
   trunk/lessons/black/
   trunk/lessons/freq10/
   trunk/lessons/mounce/
Modified:
   trunk/Makefile
   trunk/genfcmobile.sh
   trunk/micro/src/org/crosswire/flashcards/MicroLessonSet.java
Log:
Working micro generation code finally
renamed lessons to be more consistent


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2007-10-29 06:10:28 UTC (rev 123)
+++ trunk/Makefile	2007-11-08 03:43:50 UTC (rev 124)
@@ -23,7 +23,8 @@
 	cp -f FlashCards/lessons.jar /home/flashcards/html/webstart/
 
 mobile: 
-	JAVA_HOME=/usr/java/j2sdk1.4.2_05 ant -f build.micro1.xml
+#	JAVA_HOME=/usr/java/j2sdk1.4.2_05 ant -f build.micro1.xml
+	ant -f build.micro1.xml
 	./genfcmobile.sh
 
 mobileclean:

Modified: trunk/genfcmobile.sh
===================================================================
--- trunk/genfcmobile.sh	2007-10-29 06:10:28 UTC (rev 123)
+++ trunk/genfcmobile.sh	2007-11-08 03:43:50 UTC (rev 124)
@@ -21,7 +21,7 @@
   mv ~/.flashcards/lessons/$1/images lessons/$1/
   mv lessons res/
   rm lessons.jar
-  echo LessonSet0=$1$partNumber > res/lessons/lessons.properties
+  echo LessonSet0=$1 > res/lessons/lessons.properties
   echo LessonDescription0=$1$partNumber >> res/lessons/lessons.properties
   PKGNAME=fc$i$partNumber
   sed s/##NAME##/${PKGNAME}/ ../micro/bin/MANIFEST.MF > MANIFEST.MF
@@ -31,18 +31,29 @@
   cd ${WORKDIR}
   JARSIZE=`ls -l ${PKGNAME}.jar |cut -f5 -d' '`
   sed -i s/##SIZE##/${JARSIZE}/ ${PKGNAME}.jad
-  cat >> index.html <<!
+  cat >> packages/index.html <<!
   <a href="/fc/${PKGNAME}.jad">$i$partNumber</a><br/>
 !
+  mv ${PKGNAME}.ja[dr] packages
 }
 
+padjNum() {
+    jNumPad=$jNum
+    if [ "$jNum" -lt 10 ]; then
+		jNumPad=0$jNumPad
+    fi
+    if [ "$jNum" -lt 100 ]; then
+		jNumPad=0$jNumPad
+    fi
+}
 
-JAVA_HOME=/usr/java/j2sdk1.4.2_05
+
+#JAVA_HOME=/usr/java/j2sdk1.4.2_05
 WORKDIR=fcMobilePackage.$$
 MAX_LESSON_WORDS=200
 
 echo setting up workspace at $WORKDIR
-mkdir $WORKDIR
+mkdir -p $WORKDIR/packages
 
 echo copying jars
 cp target/install/lessons.jar $WORKDIR
@@ -56,7 +67,7 @@
 mv lessons lessons.orig
 rm lessons.jar
 
-cat > index.html <<!
+cat > packages/index.html <<!
 <html><head><title>CrossWire</title></head><body><b>Flashcards</b><br/>This is an early release of a micro edition of Flashcards from CrossWire Bible Society. To try it out, click on the link below below:<br/>
 <a href="/fc/FlashcardsMobile.jad">Flashcards - Hebrew</a><br/>
 <a href="/fc/oldphone/FlashcardsMobile.jad">Flashcards(old phones) - Hebrew</a><br/>
@@ -91,7 +102,8 @@
       mkdir -p res
       cd lessons.orig/$i
     fi
-    cp $j ../../lessons/$i/lesson${jNum}.flash
+    padjNum
+    cp $j ../../lessons/$i/lesson${jNumPad}.flash
     jNum=$(($jNum+1))
   done
   cd ../../
@@ -103,6 +115,6 @@
     genpackage $i
   fi
 done
-cat >> index.html <<!
+cat >> packages/index.html <<!
 </body></html>
 !

Copied: trunk/lessons/greekBlack (from rev 123, trunk/lessons/black)

Copied: trunk/lessons/greekMounce (from rev 123, trunk/lessons/mounce)

Copied: trunk/lessons/greekMounceFreq (from rev 123, trunk/lessons/freq10)

Copied: trunk/lessons/greekParsing (from rev 123, trunk/lessons/GreekParsing)

Copied: trunk/lessons/hebrewParsing (from rev 123, trunk/lessons/HebrewParsing)

Copied: trunk/lessons/hebrewWegner (from rev 123, trunk/lessons/HebrewWegner)

Copied: trunk/lessons/hebrewWegner2 (from rev 123, trunk/lessons/HebrewWegner2)

Modified: trunk/micro/src/org/crosswire/flashcards/MicroLessonSet.java
===================================================================
--- trunk/micro/src/org/crosswire/flashcards/MicroLessonSet.java	2007-10-29 06:10:28 UTC (rev 123)
+++ trunk/micro/src/org/crosswire/flashcards/MicroLessonSet.java	2007-11-08 03:43:50 UTC (rev 124)
@@ -42,11 +42,18 @@
       */
      protected void load() {
 		for (int i = 0; true; i++) {
-			String path = getURL() + "/" + "lesson" + Integer.toString(i) + ".flash";
+			String path = getURL() + "/" + "lesson" + padInt(i) + ".flash";
 			try {
 				add(new MicroLesson(path));
 			}
 			catch (Exception e) { break; }
 		}
      }
+
+	String padInt(int i) {
+		String ret = Integer.toString(i);
+		if (i < 100) ret = "0"+ret;
+		if (i < 10 ) ret = "0"+ret;
+		return ret;
+	}
 }




More information about the sword-cvs mailing list