def _system(self, cmd):
"""INTERNAL: run COMMAND in a subshell.
- Standard input for the command is taken fron /dev/null.
+ Standard input for the command is taken from /dev/null.
Raise IOError when the exit status is not zero.
# - Manipulate the time base:
# = resample at a fixed rate
# = divide the time codes by a speed factor (to make it go faster/slower)
-# = drop frames that are less than n msec apart (to accomodate slow players)
+# = drop frames that are less than n msec apart (to accommodate slow players)
# - Convert to a different format
# - Magnify (scale) the image
#
# - resample at a fixed rate
# - divide the time codes by a speed factor (to make it go faster/slower)
-# - drop frames that are less than n msec apart (to accomodate slow players)
+# - drop frames that are less than n msec apart (to accommodate slow players)
# Usage:
def _qsize(self):
return len(self.queue)
- # Check wheter the queue is empty
+ # Check whether the queue is empty
def _empty(self):
return not self.queue
# XXXX Note: currently, textfiles appear in mac-form on all platforms.
# We seem to lack a simple character-translate in python.
# (we should probably use ISO-Latin-1 on all but the mac platform).
-# XXXX The simeple routines are too simple: they expect to hold the complete
+# XXXX The simple routines are too simple: they expect to hold the complete
# files in-core. Should be fixed.
# XXXX It would be nice to handle AppleDouble format on unix
# (for servers serving macs).
try:
openrf = MacOS.openrf
except AttributeError:
- # Backward compatability
+ # Backward compatibility
openrf = open
def FInfo():
"""Calendar printing functions"""
-# Revision 2: uses funtions from built-in time module
+# Revision 2: uses functions from built-in time module
# Import functions and variables from time module
from time import localtime, mktime
should be disabled by the "dry run" flag, and should announce
themselves if the current verbosity level is high enough. This
method takes care of all that bureaucracy for you; all you have to
- do is supply the funtion to call and an argument tuple for it (to
+ do is supply the function to call and an argument tuple for it (to
embody the "external action" being performed), a message to print
if the verbosity level is high enough, and an optional verbosity
threshold.
"""distutils.command.build_ext
Implements the Distutils 'build_ext' command, for building extension
-modules (currently limited to C extensions, should accomodate C++
+modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""
# created 1999/08/09, Greg Ward
# Next, compile the source code to object files.
# XXX not honouring 'define_macros' or 'undef_macros' -- the
- # CCompiler API needs to change to accomodate this, and I
+ # CCompiler API needs to change to accommodate this, and I
# want to do one thing at a time!
# Two possible sources for extra compiler arguments:
return os.path.normpath(path)
-# More backwards compatability hacks
+# More backwards compatibility hacks
def extend (list, new_list):
"""Appends the list 'new_list' to 'list', just like the 'extend()'
list method does in Python 1.5.2 -- but this works on earlier
# provides enough benefit to be worth using, and will submit their
# version numbering scheme to its domination. The free-thinking
# anarchists in the lot will never give in, though, and something needs
-# to be done to accomodate them.
+# to be done to accommodate them.
#
# Perhaps a "moderately strict" version class could be implemented that
# lets almost anything slide (syntactically), and makes some heuristic
return s
-# Return wheter a path is absolute.
+# Return whether a path is absolute.
# Trivial in Posix, harder on the Mac or MS-DOS.
def isabs(s):
# Expand paths containing shell variable substitutions.
# This expands the forms $variable and ${variable} only.
-# Non-existant variables are left unchanged.
+# Non-existent variables are left unchanged.
_varprog = None
def _qsize(self):
return len(self.queue)
- # Check wheter the queue is empty
+ # Check whether the queue is empty
def _empty(self):
return not self.queue
# Opening should now fail!
try:
key = OpenKey(root_key, test_key_name)
- assert 0, "Could open the non-existant key"
+ assert 0, "Could open the non-existent key"
except WindowsError: # Use this error name this time
pass
return fnmatchcase(name, pat)
def fnmatchcase(name, pat):
- """Test wheter FILENAME matches PATTERN, including case.
+ """Test whether FILENAME matches PATTERN, including case.
This is a version of fnmatch() which doesn't case-normalize
its arguments.
The language code corresponds to RFC 1766. code and encoding
can be None in case the values cannot be determined or are
- unkown to this implementation.
+ unknown to this implementation.
"""
code = normalize(localename)
elif code == 'C':
return None, None
else:
- raise ValueError,'unkown locale: %s' % localename
+ raise ValueError,'unknown locale: %s' % localename
return l
def _build_localename(localetuple):
BOTTOM_UP = 1
#
-# SGI Proprietaty Algorithm Header Start Code
+# SGI Proprietary Algorithm Header Start Code
#
HEADER_START_CODE = 0xc1C0DEC
return datum[1]
#
# Internal: parse fd form, or skip if name doesn't match.
-# the special value None means 'allways parse it'.
+# the special value None means 'always parse it'.
#
def _parse_fd_form(file, name):
datum = _parse_1_line(file)
return None
#
-# Internal class: a convient place to store object info fields
+# Internal class: a convenient place to store object info fields
#
class _newobj:
def add(self, name, value):
#
# Support for the Panel library.
# Uses built-in module 'pnl'.
-# Applciations should use 'panel.function' instead of 'pnl.function';
+# Applications should use 'panel.function' instead of 'pnl.function';
# most 'pnl' functions are transparently exported by 'panel',
# but dopanel() is overridden and you have to use this version
# if you want to use callbacks.
print 'assign failed:', stmt
-# Build a real actuator from an actuator descriptior.
+# Build a real actuator from an actuator description.
# Return a pair (actuator, name).
#
def build_actuator(descr):
return datum[1]
#
# Internal: parse fd form, or skip if name doesn't match.
-# the special value None means 'allways parse it'.
+# the special value None means 'always parse it'.
#
def _parse_fd_form(file, name):
datum = _parse_1_line(file)
return None
#
-# Internal class: a convient place to store object info fields
+# Internal class: a convenient place to store object info fields
#
class _newobj:
def add(self, name, value):
#
# Support for the Panel library.
# Uses built-in module 'pnl'.
-# Applciations should use 'panel.function' instead of 'pnl.function';
+# Applications should use 'panel.function' instead of 'pnl.function';
# most 'pnl' functions are transparently exported by 'panel',
# but dopanel() is overridden and you have to use this version
# if you want to use callbacks.
print 'assign failed:', stmt
-# Build a real actuator from an actuator descriptior.
+# Build a real actuator from an actuator description.
# Return a pair (actuator, name).
#
def build_actuator(descr):
return s
-# Return wheter a path is absolute.
+# Return whether a path is absolute.
# Trivial in Posix, harder on the Mac or MS-DOS.
def isabs(s):
# Expand paths containing shell variable substitutions.
# This expands the forms $variable and ${variable} only.
-# Non-existant variables are left unchanged.
+# Non-existent variables are left unchanged.
_varprog = None
# <foo> and </foo>, respectively, or do_foo to handle <foo> by itself.
# (Tags are converted to lower case for this purpose.) The data
# between tags is passed to the parser by calling self.handle_data()
-# with some data as argument (the data may be split up in arbutrary
+# with some data as argument (the data may be split up in arbitrary
# chunks). Entity references are passed by calling
# self.handle_entityref() with the entity reference as argument.
#
# Set the string encoding used by the Unicode implementation to the
# encoding used by the default locale of this system. If the default
-# encoding cannot be determined or is unkown, it defaults to 'ascii'.
+# encoding cannot be determined or is unknown, it defaults to 'ascii'.
#
def locale_aware_defaultencoding():
import locale
alattrs = ['__doc__', '__name__', 'getdefault', 'getminmax', 'getname', 'getparams',
'newconfig', 'openport', 'queryparams', 'setparams']
-# This is a very inobstrusive test for the existance of the al module and all it's
+# This is a very unobtrusive test for the existence of the al module and all it's
# attributes. More comprehensive examples can be found in Demo/al
def main():
# Different base:
if int("10",16) <> 16L: raise TestFailed, 'int("10",16)'
if int(u"10",16) <> 16L: raise TestFailed, 'int(u"10",16)'
-# Test conversion fron strings and various anomalies
+# Test conversion from strings and various anomalies
L = [
('0', 0),
('1', 1),
'ident', 'index', 'msftoframe', 'open', 'pnum', 'ptime']
-# This is a very inobstrusive test for the existance of the cd module and all it's
+# This is a very inobtrusive test for the existence of the cd module and all it's
# attributes. More comprehensive examples can be found in Demo/cd and
# require that you have a CD and a CD ROM drive
'YUV422DC', 'YUV422HC', '__doc__', '__name__', 'cvt_type', 'error']
-# This is a very inobstrusive test for the existance of the cl
+# This is a very inobtrusive test for the existence of the cl
# module and all it's attributes.
def main():
else:
print 'fakename', fakename, 'did not except pwd.getpwnam()'
-# Choose a non-existant uid.
+# Choose a non-existent uid.
fakeuid = 4127
while byuids.has_key(fakeuid):
fakeuid = (fakeuid * 3) % 0x10000
# Opening should now fail!
try:
key = OpenKey(root_key, test_key_name)
- assert 0, "Could open the non-existant key"
+ assert 0, "Could open the non-existent key"
except WindowsError: # Use this error name this time
pass
buf = file.read() * 8
file.close()
-# test the chucksums (hex so the test doesn't break on 64-bit machines)
+# test the checksums (hex so the test doesn't break on 64-bit machines)
print hex(zlib.crc32('penguin')), hex(zlib.crc32('penguin', 1))
print hex(zlib.adler32('penguin')), hex(zlib.adler32('penguin', 1))
_opener = opener
# do these error classes make sense?
-# make sure all of the IOError stuff is overriden. we just want to be
+# make sure all of the IOError stuff is overridden. we just want to be
# subtypes.
class URLError(IOError):
# special names to handle tags: start_foo and end_foo to handle <foo>
# and </foo>, respectively. The data between tags is passed to the
# parser by calling self.handle_data() with some data as argument (the
-# data may be split up in arbutrary chunks).
+# data may be split up in arbitrary chunks).
class XMLParser:
attributes = {} # default, to be overridden