summaryrefslogtreecommitdiffstats
path: root/Demo/sgi
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1993-09-27 12:50:06 (GMT)
committerSjoerd Mullender <sjoerd@acm.org>1993-09-27 12:50:06 (GMT)
commitf993d287946d9fc4d9d7172bf66cce44c253851e (patch)
treeca7f076c749fbc1f786485da1112ac9db9b6931d /Demo/sgi
parentc9d73d1f64ae1119194848ba40ef40e31fefc029 (diff)
downloadcpython-f993d287946d9fc4d9d7172bf66cce44c253851e.zip
cpython-f993d287946d9fc4d9d7172bf66cce44c253851e.tar.gz
cpython-f993d287946d9fc4d9d7172bf66cce44c253851e.tar.bz2
Don't import gl if not needed.
Fixed a typo.
Diffstat (limited to 'Demo/sgi')
-rwxr-xr-xDemo/sgi/video/VFile.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Demo/sgi/video/VFile.py b/Demo/sgi/video/VFile.py
index b375299..0c8aa52 100755
--- a/Demo/sgi/video/VFile.py
+++ b/Demo/sgi/video/VFile.py
@@ -18,8 +18,12 @@
# Imported modules
import sys
-import gl
-import GL
+try:
+ import gl
+ import GL
+ no_gl = 0
+except ImportError:
+ no_gl = 1
import GET
import colorsys
import imageop
@@ -340,6 +344,9 @@ class Displayer(VideoParams):
# This does not need a current window
def init(self):
+ if no_gl:
+ raise RuntimeError, \
+ 'no gl module available, so cannot display'
self = VideoParams.init(self)
# User-settable parameters
self.magnify = 1.0 # frame magnification factor
@@ -377,7 +384,7 @@ class Displayer(VideoParams):
if self.upside_down:
gl.pixmode(GL.PM_TTOB, 1)
if self.mirror_image:
- gp.pixmode(GL.PM_RTOL, 1)
+ gl.pixmode(GL.PM_RTOL, 1)
if self.format in ('jpeg', 'jpeggrey'):
import jpeg
data, width, height, bytes = jpeg.decompress(data)