]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
*** empty log message ***
authorGuido van Rossum <guido@python.org>
Fri, 17 Dec 1993 14:57:24 +0000 (14:57 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 17 Dec 1993 14:57:24 +0000 (14:57 +0000)
Demo/sgi/flp/test_cb.py
Demo/sgi/flp/test_nocb.py
Demo/sgi/gl/kunst.py
Demo/sgi/gl/mclock.py

index d622332458b8f02d453dd124a1184cbb9ba3b8d8..41635036d34a233617ff6660883ebfbda5de59b8 100755 (executable)
@@ -14,11 +14,11 @@ import sys
 # The following struct is created to hold the instance variables
 # main_form, button1, button2 and exitbutton.
 
-class myform():
+class myform:
        #
-       # The init function parses and creates the form, but doesn't
+       # The constructor parses and creates the form, but doesn't
        # display it (yet).
-       def init(self, number):
+       def __init__(self, number):
                #
                # First we parse the form
                parsetree = flp.parse_form('test_cb', 'main_form')
@@ -29,7 +29,6 @@ class myform():
 
                # And keep our number
                self.number = number
-               return self
 
        #
        # The show function displays the form. It doesn't do any interaction,
@@ -52,8 +51,8 @@ class myform():
 # The main program. Instantiate two variables of the forms class
 # and interact with them.
 
-form1 = myform().init(1)
-form2 = myform().init(2)
+form1 = myform(1)
+form2 = myform(2)
 
 form1.show()
 form2.show()
index 48cee9dfbdb07b2a65c5a5a0f1a85e3bdde8d08e..6346da3ed9c51d3b91405ea65de6a631000ee602 100755 (executable)
@@ -12,7 +12,7 @@ import sys
 # The following struct is created to hold the instance variables
 # main_form, button1, button2 and exitbutton.
 
-class struct(): pass
+class struct: pass
 container = struct()
 
 #
index efc4c6d9bf4367b942c820bfedce99a71303191f..2055e52e83953f1db8d75d42874aea61e45ab27e 100755 (executable)
@@ -51,7 +51,7 @@ def mkslice(z1, z2, nparts, docircle):
 #
 # Drawcylinder : draw the cylinder
 #
-class struct(): pass
+class struct: pass
 curobj = struct()
 curobj.curobj = 1
 def drawcylinder(cyl):
index 18fef451e005a4b2b6a481803a262a2fb69b5df3..ec39de9c8bea22343a6938fbc494809854151997 100755 (executable)
@@ -41,10 +41,10 @@ SCREENBG = 127, 156, 191
 NPARTS = 9
 TITLE = 'M Clock'
 
-import tzparse
-TZDIFF = tzparse.timezone
-if tzparse.isdst(time.time()):
-       TZDIFF = tzparse.altzone
+# Set timezone, check for daylight saving time
+TZDIFF = time.timezone
+if time.localtime(time.time())[-1]:
+       TZDIFF = time.altzone
 
 # Default parameters
 
@@ -145,7 +145,7 @@ def main():
        Gl.change = 1
        while 1:
                if realtime:
-                       localtime = time.time() - Gl.tzdiff
+                       localtime = int(time.time() - Gl.tzdiff)
                if Gl.alarm_set:
                        if localtime%(24*HOUR) == Gl.alarm_time:
                                # Ring the alarm!
@@ -313,7 +313,7 @@ def usage(exc, msg):
        print '-u update : update interval [60]'
        print '-CMYK     : Cyan, Magenta, Yellow or blacK overlay only'
        print 'if hh [mm [ss]] is specified, display that time statically'
-       print 'on machines with < 12 bitplanes, -c and -s are forced on'
+       print 'on machines with < 12 bitplanes, -s is forced on'
        #
        sys.exit(2)
 
@@ -329,7 +329,8 @@ def makehands(localtime):
        little_hand = (MIDN + FULLC - ((localtime/12) % HOUR)) % FULLC
        return little_hand, big_hand, seconds_hand
 
-def makelist(little_hand, big_hand, seconds_hand):
+def makelist(hands):
+       little_hand, big_hand, seconds_hand = hands
        total = []
        if Gl.cyan or not Gl.colorsubset:
                total = total + makesublist(big_hand, Gl.indices[0])
@@ -476,7 +477,7 @@ def makewindow():
                prefposition(0, scrwidth-1, 0, scrheight-1)
        else:
                keepaspect(1, 1)
-               prefsize(100, 100)
+               prefsize(80, 80)
        #
        if not Gl.border:
                noborder()
@@ -495,7 +496,11 @@ def makewindow():
        if Gl.warnings:
                print nplanes, 'color planes,', nmaps, 'color maps'
        #
-       if nplanes < 12 or Gl.colormap:
+       if Gl.doublebuffer and not Gl.colormap and nplanes < 12:
+               if Gl.warnings: print 'forcing single buffer mode'
+               Gl.doublebuffer = 0
+       #
+       if Gl.colormap:
                if not Gl.colormap:
                        Gl.colormap = nmaps - 1
                        if Gl.warnings: