Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96b608c

Browse files
committed
*** empty log message ***
1 parent 1b789f9 commit 96b608c

4 files changed

Lines changed: 21 additions & 17 deletions

File tree

Demo/sgi/flp/test_cb.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
# The following struct is created to hold the instance variables
1515
# main_form, button1, button2 and exitbutton.
1616

17-
class myform():
17+
class myform:
1818
#
19-
# The init function parses and creates the form, but doesn't
19+
# The constructor parses and creates the form, but doesn't
2020
# display it (yet).
21-
def init(self, number):
21+
def __init__(self, number):
2222
#
2323
# First we parse the form
2424
parsetree = flp.parse_form('test_cb', 'main_form')
@@ -29,7 +29,6 @@ def init(self, number):
2929

3030
# And keep our number
3131
self.number = number
32-
return self
3332

3433
#
3534
# The show function displays the form. It doesn't do any interaction,
@@ -52,8 +51,8 @@ def exitbuttonCB(self, obj, arg):
5251
# The main program. Instantiate two variables of the forms class
5352
# and interact with them.
5453

55-
form1 = myform().init(1)
56-
form2 = myform().init(2)
54+
form1 = myform(1)
55+
form2 = myform(2)
5756

5857
form1.show()
5958
form2.show()

Demo/sgi/flp/test_nocb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# The following struct is created to hold the instance variables
1313
# main_form, button1, button2 and exitbutton.
1414

15-
class struct(): pass
15+
class struct: pass
1616
container = struct()
1717

1818
#

Demo/sgi/gl/kunst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def mkslice(z1, z2, nparts, docircle):
5151
#
5252
# Drawcylinder : draw the cylinder
5353
#
54-
class struct(): pass
54+
class struct: pass
5555
curobj = struct()
5656
curobj.curobj = 1
5757
def drawcylinder(cyl):

Demo/sgi/gl/mclock.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class struct: pass # Class to define featureless structures
4141
NPARTS = 9
4242
TITLE = 'M Clock'
4343

44-
import tzparse
45-
TZDIFF = tzparse.timezone
46-
if tzparse.isdst(time.time()):
47-
TZDIFF = tzparse.altzone
44+
# Set timezone, check for daylight saving time
45+
TZDIFF = time.timezone
46+
if time.localtime(time.time())[-1]:
47+
TZDIFF = time.altzone
4848

4949
# Default parameters
5050

@@ -145,7 +145,7 @@ def main():
145145
Gl.change = 1
146146
while 1:
147147
if realtime:
148-
localtime = time.time() - Gl.tzdiff
148+
localtime = int(time.time() - Gl.tzdiff)
149149
if Gl.alarm_set:
150150
if localtime%(24*HOUR) == Gl.alarm_time:
151151
# Ring the alarm!
@@ -313,7 +313,7 @@ def usage(exc, msg):
313313
print '-u update : update interval [60]'
314314
print '-CMYK : Cyan, Magenta, Yellow or blacK overlay only'
315315
print 'if hh [mm [ss]] is specified, display that time statically'
316-
print 'on machines with < 12 bitplanes, -c and -s are forced on'
316+
print 'on machines with < 12 bitplanes, -s is forced on'
317317
#
318318
sys.exit(2)
319319

@@ -329,7 +329,8 @@ def makehands(localtime):
329329
little_hand = (MIDN + FULLC - ((localtime/12) % HOUR)) % FULLC
330330
return little_hand, big_hand, seconds_hand
331331

332-
def makelist(little_hand, big_hand, seconds_hand):
332+
def makelist(hands):
333+
little_hand, big_hand, seconds_hand = hands
333334
total = []
334335
if Gl.cyan or not Gl.colorsubset:
335336
total = total + makesublist(big_hand, Gl.indices[0])
@@ -476,7 +477,7 @@ def makewindow():
476477
prefposition(0, scrwidth-1, 0, scrheight-1)
477478
else:
478479
keepaspect(1, 1)
479-
prefsize(100, 100)
480+
prefsize(80, 80)
480481
#
481482
if not Gl.border:
482483
noborder()
@@ -495,7 +496,11 @@ def makewindow():
495496
if Gl.warnings:
496497
print nplanes, 'color planes,', nmaps, 'color maps'
497498
#
498-
if nplanes < 12 or Gl.colormap:
499+
if Gl.doublebuffer and not Gl.colormap and nplanes < 12:
500+
if Gl.warnings: print 'forcing single buffer mode'
501+
Gl.doublebuffer = 0
502+
#
503+
if Gl.colormap:
499504
if not Gl.colormap:
500505
Gl.colormap = nmaps - 1
501506
if Gl.warnings:

0 commit comments

Comments
 (0)