gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz metacode/pegboard.py gfx/jni/GzzGL-jni.cxx ...


From: Asko Soukka
Subject: [Gzz-commits] gzz metacode/pegboard.py gfx/jni/GzzGL-jni.cxx ...
Date: Tue, 12 Nov 2002 11:53:07 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    02/11/12 11:53:04

Modified files:
        metacode       : pegboard.py 
        gfx/jni        : GzzGL-jni.cxx 
        test/gzz/gfx/jni: jnistrconv.test 
        gzz/gfx/gl     : GL_Testing.java 
        doc/pegboard   : .cvsignore 
        doc/pegboard/vobcoorder_culling--humppake: peg.rst 

Log message:
        .cvsignore-fix and other for pegboard.py

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/pegboard.py.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.60&tr2=1.61&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/jni/jnistrconv.test.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GL_Testing.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/.cvsignore.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/vobcoorder_culling--humppake/peg.rst.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: gzz/doc/pegboard/.cvsignore
diff -u gzz/doc/pegboard/.cvsignore:1.6 gzz/doc/pegboard/.cvsignore:1.7
--- gzz/doc/pegboard/.cvsignore:1.6     Mon Nov 11 05:17:53 2002
+++ gzz/doc/pegboard/.cvsignore Tue Nov 12 11:53:04 2002
@@ -1,42 +1 @@
-201/PEG_201.html
-1001/PEG_1001.html
-1004/PEG_1004.html
-1005/PEG_1005.html
-1006/PEG_1006.html
-1007/PEG_1007.html
-1008/PEG_1008.html
-1009/PEG_1009.html
-1010/PEG_1010.html
-1011/PEG_1011.html
-1012/PEG_1012.html
-1013/PEG_1013.html
-1014/PEG_1014.html
-1015/PEG_1015.html
-1016/PEG_1016.html
-1017/PEG_1017.html
-1018/PEG_1018.html
-1019/PEG_1019.html
-1020/PEG_1020.html
-1021/click.html
-1022/keys.html
-email_storage--marc/peg.html
-cellview_naming/peg.html
-vobcoorder_parents--tjl/peg.html
-search_bindings--benja/peg.html
-chug_shear_twirl--benja/peg.html
-vobcoorder_culling--humppake/peg.html
-containment--benja/peg.html
-prefix_argument--benja/peg.html
-null_cs_api--tjl/peg.html
-grizzly_bear--benja/peg.html
-miniblocks--benja/peg.html
-pts_content_types--marc/peg.html
-box_cs--tjl/peg.html
-vobscene_hierarchies_clicks--tjl/peg.html
-vobscene_twids--tjl/peg.html
-vobcoorder_fontscale--tjl/peg.html
-view_split--tjl/peg.html
-vobcoorder_isActive--tjl/peg.html
-w2sx--tjl/peg.html
-styled_text--benja/peg.html
 pegboard.html
Index: gzz/doc/pegboard/vobcoorder_culling--humppake/peg.rst
diff -u gzz/doc/pegboard/vobcoorder_culling--humppake/peg.rst:1.6 
gzz/doc/pegboard/vobcoorder_culling--humppake/peg.rst:1.7
--- gzz/doc/pegboard/vobcoorder_culling--humppake/peg.rst:1.6   Tue Nov 12 
01:37:57 2002
+++ gzz/doc/pegboard/vobcoorder_culling--humppake/peg.rst       Tue Nov 12 
11:53:04 2002
@@ -4,8 +4,8 @@
 
 :Authors:   Asko Soukka
 :Stakeholders: Tuomas Lukka
-:Date:     $Date: 2002/11/12 06:37:57 $
-:Revision: $Revision: 1.6 $
+:Date:     $Date: 2002/11/12 16:53:04 $
+:Revision: $Revision: 1.7 $
 :Status:   Current
 :Date-Created: 2002-11-05
 :Scope:    Minor
@@ -22,7 +22,7 @@
 
        /** Creates a CullingCoordSys with distinct parent and test 
         * coordinate systems. Exluding the test for drawing, the 
-        * CullingCoordSys works like its parent CoordSys. 
+        * CullingCoordSys works like its parent coordinate system. 
         *
         * This coordsys will not necessarily be drawn if the boxes
         * of the test and clip coordinate systems do not intersect.
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -u gzz/gfx/jni/GzzGL-jni.cxx:1.60 gzz/gfx/jni/GzzGL-jni.cxx:1.61
--- gzz/gfx/jni/GzzGL-jni.cxx:1.60      Mon Nov 11 07:01:31 2002
+++ gzz/gfx/jni/GzzGL-jni.cxx   Tue Nov 12 11:53:03 2002
@@ -103,6 +103,29 @@
 jstring stdstr2jstr(JNIEnv *env, std::string stdstr) {
   return env->NewStringUTF(stdstr.c_str());
 }
+/** Converts jstring to unistring _without_ asking
+ * string length from JNIEnv. This could have been
+ * the non-null-string bug, Benja founded. Although, 
+ * std::basic_string <unsigned short> doesn't seem
+ * to be valid anymore: "undefined symbol:
+ * std::char_traits<unsigned short>::length(unsigned short const*)"
+ *
+ * Anyway, these can be dropped, when cleaning Gzz-Gl-jni
+ * and this is considered to be irrelevant.
+ */
+/*
+typedef std::basic_string<unsigned short> unistring;
+unistring jstr2unistr_failing(JNIEnv *env, jstring jstr) {
+  const jchar *strptr = env->GetStringChars(jstr, 0);
+  unistring unistr(strptr);
+  env->ReleaseStringChars(jstr, strptr);
+  return unistr;
+}
+/*
+jstring unistr2jstr_failing(JNIEnv *env, unistring unistr) {
+  return env->NewString(&(unistr[0]), unistr.size());
+}
+*/
 
 Os::Window *getWindowByWID(int wid) {
     return  (wid<0 ? defaultWindow : windows.get(wid));
@@ -241,6 +264,13 @@
 (JNIEnv *env, jobject obj, jstring jstr) {
   return (jdouble) atof(jstr2stdstr(env, jstr).c_str());
 }
+
+/*
+JNIEXPORT jstring JNICALL Java_gzz_gfx_gl_GL_1Testing_loopUnistrConvFailing
+(JNIEnv *env, jobject obj, jstring jstr) {
+  return unistr2jstr_failing(env, jstr2unistr_failing(env, jstr));
+}
+*/
 
 JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GL_init
   (JNIEnv *env, jclass, jint) {
Index: gzz/gzz/gfx/gl/GL_Testing.java
diff -u gzz/gzz/gfx/gl/GL_Testing.java:1.2 gzz/gzz/gfx/gl/GL_Testing.java:1.3
--- gzz/gzz/gfx/gl/GL_Testing.java:1.2  Wed Oct  9 02:50:26 2002
+++ gzz/gzz/gfx/gl/GL_Testing.java      Tue Nov 12 11:53:04 2002
@@ -23,6 +23,7 @@
 
     /** Exists for testing string conversions through JNI. */
     static public native String loopUnistrConv(String str);
+//    static public native String loopUnistrConvFailing(String str);
     static public native String loopStdstrConv(String str);
     static public native double useAtof(String str);
 }
Index: gzz/metacode/pegboard.py
diff -u gzz/metacode/pegboard.py:1.15 gzz/metacode/pegboard.py:1.16
--- gzz/metacode/pegboard.py:1.15       Mon Nov 11 10:39:26 2002
+++ gzz/metacode/pegboard.py    Tue Nov 12 11:53:03 2002
@@ -134,16 +134,14 @@
 #holds all information of pegs to show on the pegboard
 pegtable = []
 
-#holds names and subpaths of all generated files under pegroot
-cvsignore = []
-
 #converts all rsts' in pegdirs and parses pegs' meta information
 #from pegs' main files
 for pegdir in pegdirs:
     print 'Process PEG %s' % (pegdir)
 
     peg = {'authors': '', 'status': undefined, 'topic': pegdir, 
'stakeholders': '', 
-           'date': '', 'dir': pegdir, 'files': '', 'html': '', 'rst': '' }
+           'date': '', 'dir': pegdir, 'files': '', 'html': '', 'rst': '',
+           'rstfiles': [], 'cvsignore': [] }
 
     pegfiles = [f for f in os.listdir(pegroot+'/'+pegdir+'/') \
                if os.path.isfile(pegroot+'/'+pegdir+'/'+f) and not 
f.startswith('.')]
@@ -158,8 +156,7 @@
             if pegfile.endswith('.rst'):
                 peg['rst'] = pegfile
 
-    rstfiles = [f for f in os.listdir(pegroot+'/'+pegdir+'/') \
-                if os.path.isfile(pegroot+'/'+pegdir+'/'+f) and 
f.endswith('.rst')]
+    rstfiles = [f for f in peg['files'] if f.endswith('.rst')]
 
     for rstfile in rstfiles:
         #creates and setups a new docutils.core.Publisher, which seems to be
@@ -177,7 +174,7 @@
             document = pub.reader.read(pub.source, pub.parser, pub.settings)
             pub.apply_transforms(document)
             output = pub.writer.write(document, pub.destination)
-            cvsignore.append(pegdir+'/'+rstfile[0:len(rstfile)-4]+'.html')
+            peg['cvsignore'].append(rstfile[0:len(rstfile)-4]+'.html')
             peg['html'] = rstfile[0:len(rstfile)-4]+'.html'
 
             #conversion have succeeded so far, parsing peg's metadata
@@ -201,6 +198,11 @@
                 if not peg['stakeholders']:
                     peg['stakeholders'] = getFieldTagValue(document, 
'stakeholders')
                 peg['authors'] = getTagValue(document, 'author', all=1)
+            else:
+                status = getTagValue(document, 'status')
+                if status:
+                    peg['rstfiles'].append({'filename': rstfile, 'status': 
status})
+                
         except:
             fails += 'PEG %s: Docutil raised an exception while converting %s. 
' % (pegdir, rstfile)
             fails += 'Conversion failed and HTML not created.\n'
@@ -219,7 +221,7 @@
 
 
 #converts pegboard.rst, reads results into buffer and opens pegboard.html for 
writing
-print 'Generating '+pegroot+'/pegboard.html...'
+print 'Generating '+pegroot+'/pegboard.html'
 args = '-stg --stylesheet '+css+' '+pegroot+'/pegboard.rst 
'+pegroot+'/pegboard.html'
 publish_cmdline(writer_name='html', argv=args.split())
 
@@ -274,10 +276,33 @@
             replace_str += '\n\t</td>\n'
             replace_str += '\t<td>\n'
             for file in peg['files']:
-                replace_str += '\t\t<a href=\"'+peg['dir']+'/'+file+'\">' \
-                               +file+'</a>'
-                if peg['files'].index(file) < len(peg['files']) -1:
-                    replace_str += '<br/>'
+                try:
+                    if peg['cvsignore'].index(file):
+                        pass
+                except ValueError:
+                    converted = 0
+                    status = 0
+                    if file != peg['rst']:
+                        for rstfile in peg['rstfiles']:
+                            if rstfile['filename'] == file:
+                                status = rstfile['status']
+                        for htmlfile in peg['cvsignore']:
+                            if htmlfile == file[0:len(file)-4]+'.html':
+                                converted = htmlfile
+                    if converted:
+                        if status:
+                            replace_str += '\t\t<a 
class=\"peg-'+status.split()[0].lower()+ \
+                                       '\" 
'+'href=\"'+peg['dir']+'/'+converted+'\">'+ \
+                                       converted+'</a>'
+                        else:
+                            replace_str += '\t\t<a 
href=\"'+peg['dir']+'/'+converted+'\">'+ \
+                                       converted+'</a>'
+                    else:
+                        replace_str += '\t\t<a 
href=\"'+peg['dir']+'/'+file+'\">' \
+                                       +file+'</a>'
+                    if peg['files'].index(file) < len(peg['files']) -1:
+                        replace_str += '<br/>\n'
+
             replace_str += '\n\t<td>\n'
             replace_str += '</tr>\n'
 
@@ -286,14 +311,39 @@
     pegboard.write(pegboard_line)
 
 pegboard.close()
-cvsignore.append('pegboard.html')
 
-#generate .cvsignore for generated html-files
-print 'Replacing '+pegroot+'/.cvsignore...'
-cvsignorefile = open(pegroot+'/.cvsignore', 'w')
-for ignore in cvsignore:
-    cvsignorefile.write(ignore+'\n')
-cvsignorefile.close()
+#generate .cvsignores for generated html-files
+if os.path.isfile(pegroot+'/.cvsignore'):
+    cvsignorefile = open(pegroot+'/.cvsignore', 'r')
+    if cvsignorefile.read().find('pegboard.html') == -1:
+        print 'Updating '+pegroot+'/.cvsignore'
+        cvsignorefile.close()
+        cvsignorefile = open(pegroot+'/.cvsignore', 'a')
+        cvsignorefile.write('pegboard.html\n')
+    cvsignorefile.close()
+else:
+    print 'Creating '+pegroot+'/.cvsignore'    
+    cvsignorefile = open(pegroot+'/.cvsignore', 'w')
+    cvsignorefile.write('pegboard.html\n')
+    cvsignorefile.close()
+
+for peg in pegtable:
+    if os.path.isfile(pegroot+'/'+peg['dir']+'/.cvsignore'):
+        cvsignorefile = open(pegroot+'/'+peg['dir']+'/.cvsignore', 'r')
+        oldignore = cvsignorefile.read()
+        cvsignorefile.close()
+        cvsignorefile = open(pegroot+'/'+peg['dir']+'/.cvsignore', 'a')
+        for ignore in peg['cvsignore']:
+            if oldignore.find(ignore) == -1:
+                print 'Updating '+pegroot+'/'+peg['dir']+'/.cvsignore'
+                cvsignorefile.write(ignore+'\n')
+        cvsignorefile.close()
+    else:
+        print 'Creating '+pegroot+'/'+peg['dir']+'/.cvsignore'        
+        cvsignorefile = open(pegroot+'/'+peg['dir']+'/.cvsignore', 'w')
+        for ignore in peg['cvsignore']:
+            cvsignorefile.write(ignore+'\n')
+        cvsignorefile.close()
 
 if fails != 'XXX\n':
     print fails
Index: gzz/test/gzz/gfx/jni/jnistrconv.test
diff -u gzz/test/gzz/gfx/jni/jnistrconv.test:1.6 
gzz/test/gzz/gfx/jni/jnistrconv.test:1.7
--- gzz/test/gzz/gfx/jni/jnistrconv.test:1.6    Sat Oct 12 06:18:09 2002
+++ gzz/test/gzz/gfx/jni/jnistrconv.test        Tue Nov 12 11:53:03 2002
@@ -3,6 +3,11 @@
 from gzz.gfx.gl import GL_Testing
 import java.lang.String
 
+#def testUniScandJavaSubstr_failing():
+#    str = java.lang.String("Viime yönä Åke jutteli Äreälle Örisijälle 
åskardeista.")
+#    failIf(str.substring(5,20) != 
GL_Testing.loopUnistrConvFailing(str.substring(5,20)),
+#      "Non-null-string bug detected.")
+
 def testUniAZ():
     str = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
     failIf(str != GL_Testing.loopUnistrConv(str), 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]