Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
05e46dde
Commit
05e46dde
authored
Dec 14, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use tzparse to avoid embarrasment in other timezones or when DST changes.
Adapt to new, stricter, rules for argument passing.
parent
89a78697
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
Demo/sgi/gl/mclock.py
Demo/sgi/gl/mclock.py
+9
-9
No files found.
Demo/sgi/gl/mclock.py
View file @
05e46dde
#! /usr/local/python
#############################################################################
# NOTA BENE: Before installing, fix TZDIFF to reflect your local time zone! #
#############################################################################
#! /usr/local/bin/python
# "M Clock"
#
...
...
@@ -44,7 +40,11 @@ Gl = struct() # Object to hold writable global variables
SCREENBG
=
127
,
156
,
191
NPARTS
=
9
TITLE
=
'M Clock'
TZDIFF
=
-
2
*
HOUR
# <--- change this to reflect your local time zone
import
tzparse
TZDIFF
=
tzparse
.
timezone
if
tzparse
.
isdst
(
time
.
time
()):
TZDIFF
=
tzparse
.
altzone
# Default parameters
...
...
@@ -412,7 +412,7 @@ def render(list, (little_hand, big_hand, seconds_hand)):
resetindex
()
#
if
not
list
:
Gl
.
c3i
(
255
,
255
,
255
)
# White
Gl
.
c3i
(
(
255
,
255
,
255
)
)
# White
circf
(
0.0
,
0.0
,
1.0
)
else
:
list
.
append
(
3600
,
0
,
255
)
# Sentinel
...
...
@@ -424,7 +424,7 @@ def render(list, (little_hand, big_hand, seconds_hand)):
[
r
,
g
,
b
]
=
rgb
if
Gl
.
debug
>
1
:
print
rgb
,
a_prev
,
a
Gl
.
c3i
(
r
,
g
,
b
)
Gl
.
c3i
(
(
r
,
g
,
b
)
)
arcf
(
0.0
,
0.0
,
1.0
,
a_prev
,
a
)
rgb
[
icolor
]
=
value
a_prev
=
a
...
...
@@ -433,7 +433,7 @@ def render(list, (little_hand, big_hand, seconds_hand)):
#
# Draw the hands -- in black
#
Gl
.
c3i
(
0
,
0
,
0
)
Gl
.
c3i
(
(
0
,
0
,
0
)
)
#
if
Gl
.
update
==
1
and
not
Gl
.
iconic
:
# Seconds hand is only drawn if we update every second
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment