gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gzz/modules/pp demotest.py


From: Matti Katila
Subject: [Gzz-commits] gzz/gzz/modules/pp demotest.py
Date: Tue, 07 Jan 2003 04:20:25 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   03/01/07 04:20:25

Modified files:
        gzz/modules/pp : demotest.py 

Log message:
        load the space from disk at beginning.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/demotest.py.diff?tr1=1.44&tr2=1.45&r1=text&r2=text

Patches:
Index: gzz/gzz/modules/pp/demotest.py
diff -u gzz/gzz/modules/pp/demotest.py:1.44 gzz/gzz/modules/pp/demotest.py:1.45
--- gzz/gzz/modules/pp/demotest.py:1.44 Mon Jan  6 06:20:54 2003
+++ gzz/gzz/modules/pp/demotest.py      Tue Jan  7 04:20:24 2003
@@ -19,7 +19,7 @@
 enfMaker = gzz.media.impl.Enfilade1DImpl.Enfilade1DImplMaker()
 
 
-AbstractUpdateManager.defaultAnimationTime = 3000
+#AbstractUpdateManager.defaultAnimationTime = 3000
 # AbstractUpdateManager.fractCalc = AbstractUpdateManager.LinearCalculator()
 
 obsTrigger = SimpleObsTrigger();
@@ -30,73 +30,62 @@
 identityManager = DummyIdentityManager()
 slicer = SingleSlicer("foo")
 
-space = ModularSpace(cellTexter, cellManager, dimManager, identityManager, 
slicer, obsTrigger)
-
-ppactions = gzz.modules.pp.PPActionsImpl(space)
-
-id = ppactions.newPaper()
-
-d = PPDims(space)
-
-
-n1 = ppactions.newNote(id, 100, 100, "WIgdqp")
-n1_2 = ppactions.newNote(id, 100, 200, "Foog")
-n1_3 = ppactions.newNote(id, 0, 0, "KOTI")
-
-#np = ppactions.newPaper()
-#n2 = ppactions.newNote(np, 100, 50, "VALOKUVAT")
-#n2 = ppactions.newNote(np, 100, 100, "IMG:/BIG/0000_022.jpg")
-#ppactions.assocNotes(n1_2, 1, n2)
-
-np = ppactions.newPaper()
-space.getCell(np).N(d.bgtype)
-n2 = ppactions.newNote(np, 0, 0, "KALENTERI")
-n3 = ppactions.newNote(np, 150, 250, "oijgsg")
-
-ppactions.assocNotes(n1, 1, n2)
-print "Assoc: ",n1,n2
-
-cursor = [space.getCell(n1), space.getCell(n2)]
-
-clip = GLRen.createClipSquare()
-stopclip = GLRen.createStopClipSquare()
-
-lineconn = GLRen.createLineConnector(-10, -10)
-
-
-anchors = [
-    (i, Math.random() * 100, Math.random() * 100)
-    for i in range(0,1)]
 
 class PPView2Scene:
     def __init__(self):
        w.setLocation(0,0,1024,768)
-       self.ppv = PPView2(space, w, ppactions)
-       self.ppv.bgscale = 500
-       self.poly = ["FILL", "LINE"]
-       self.avc = gzz.view.AbstractViewContext()
-       self.avc.setAccursed(space.getCell(n1))
-       self.map = None
-       self.mode = 0
-        self.space = space
-        self.d = PPDims(self.space)
-
 
         # Next, the mediaserver we'll save to.
         self.ms = gzz.mediaserver.SimpleMediaserver(
             gzz.mediaserver.storage.DirStorer(File("/tmp/pp/")))
-
-        # We'll use a fake mediaserver pointer
-        #self.pointer_id = "FOO"
-
+        
         # We need to get a "filer" for storing versions of our space.
         # Accept this part as 'magic' for now...
         self.filers = gzz.mediaserver.MediaserverFiler.Group(
             gzz.slices.SliceVersion.EMPTY_VERSION, self.ms,
             gzz.slices.YAMLVersionFormatter.YAMLVersionFormat(self.ms, 
enfMaker))
-
+        
         self.filer = self.filers.getFiler("foo")
+        self.avc = gzz.view.AbstractViewContext()
+
+        if 0:
+            #load from file
+            self.space = gzz.impl.ModularSpace(self.filer.load(), 
*tools.spaceArgList())
+            self.ppactions = gzz.modules.pp.PPActionsImpl(self.space)
+            self.d = PPDims(self.space)
+            self.avc.setAccursed(self.space.getHomeCell().s(self.d.d1))
+            
+        else:
+            self.space = ModularSpace(cellTexter, cellManager, dimManager, 
identityManager, slicer, obsTrigger)
+            self.ppactions = gzz.modules.pp.PPActionsImpl(self.space)
 
+            id = self.ppactions.newPaper()
+
+            self.d = PPDims(self.space)
+
+            n1 = self.ppactions.newNote(id, 100, 100, "WIgdqp")
+            n1_2 = self.ppactions.newNote(id, 100, 200, "Foog")
+            n1_3 = self.ppactions.newNote(id, 0, 0, "KOTI")
+
+            np = self.ppactions.newPaper()
+            n2 = self.ppactions.newNote(np, 100, 50, "VALOKUVAT")
+            n2 = self.ppactions.newNote(np, 100, 100, "IIMG:/BIG/0000_022.jpg")
+            self.ppactions.assocNotes(n1_2, 1, n2)
+
+            np = self.ppactions.newPaper()
+            self.space.getCell(np).N(self.d.bgtype)
+            n2 = self.ppactions.newNote(np, 0, 0, "KALENTERI")
+            n3 = self.ppactions.newNote(np, 150, 250, "oijgsg")
+
+            self.ppactions.assocNotes(n1, 1, n2)
+            print "Assoc: ",n1,n2
+           self.avc.setAccursed(self.space.getCell(n1))
+
+        self.ppv = PPView2(self.space, w, self.ppactions)
+        self.ppv.bgscale = 500
+        self.poly = ["FILL", "LINE"]
+        self.map = None
+        self.mode = 0
 
     def key(self, key):
        if key == "Ctrl-I":
@@ -118,7 +107,8 @@
             # set space to *everywhere* !
             self.ppv.space = self.space
             print 'Does ', n1,' exists?:', self.space.exists(n1)
-            self.avc.setAccursed(self.space.getCell(n1))
+            #self.avc.setAccursed(self.space.getCell(n1))
+            self.avc.setAccursed(space.getHomeCell().s(self.d.d1))
             self.ppv.d = PPDims(self.space)
             self.d = PPDims(self.space)
             self.ppv.ppactions.initSpace(self.space)
@@ -138,7 +128,7 @@
            c = self.avc.getAccursed()
            print "Acc: ",c
            if self.avc.getCursorOffset(c) < 0 or c.s(self.d.contains, -1) == 
None:
-               c = 
self.space.getCell(ppactions.newNote(c.h(self.d.contains).getId(), 
+               c = 
self.space.getCell(self.ppactions.newNote(c.h(self.d.contains).getId(), 
                                    int(self.ppv.panx), int(self.ppv.pany), ""))
                print "NN: ",c
                self.avc.setAccursed(c)
@@ -148,15 +138,15 @@
 
            AbstractUpdateManager.setNoAnimation()
             if len(key) == 1:
-                ppactions.insertText(c.getId(), offs, key)
+                self.ppactions.insertText(c.getId(), offs, key)
                 self.avc.setCursorOffset(offs+1)
             if key == "Backspace":
                 if offs != 0:
-                    ppactions.deleteText(c.getId(), offs-1, offs)
+                    self.ppactions.deleteText(c.getId(), offs-1, offs)
                     self.avc.setCursorOffset(offs-1)
             if key == "Delete":
                 print 'Untested! Doesn\'t check the length'
-                ppactions.deleteText(c.getId(), offs, offs+1)
+                self.ppactions.deleteText(c.getId(), offs, offs+1)
             if key == "Left":
                 if offs != 0:
                     self.avc.setCursorOffset(offs-1)
@@ -203,6 +193,17 @@
 
 
 # OLD
+#cursor = [space.getCell(n1), space.getCell(n2)]
+
+#clip = GLRen.createClipSquare()
+#stopclip = GLRen.createStopClipSquare()
+
+#lineconn = GLRen.createLineConnector(-10, -10)
+
+#anchors = [
+#    (i, Math.random() * 100, Math.random() * 100)
+#    for i in range(0,1)]
+
 
 class PlaneViewScene:
     def __init__(self):




reply via email to

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