summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2009-11-23 14:44:56 +0100
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2009-11-23 14:44:56 +0100
commitb7e84e3fc5418641041f95a80f08fe053c004c27 (patch)
treea0e0865c87e8bd127df674b53b30f3e323c1b255
parentb80f0a3c1f04c4446ab3f7ec019a3888fa098fab (diff)
downloadlogilab-common-b7e84e3fc5418641041f95a80f08fe053c004c27.tar.gz
include Dotan Barak spell fixes patch
-rw-r--r--ChangeLog32
-rw-r--r--README4
-rw-r--r--adbh.py8
-rw-r--r--cache.py4
-rw-r--r--changelog.py8
-rw-r--r--clcommands.py2
-rw-r--r--cli.py4
-rw-r--r--compat.py6
-rw-r--r--configuration.py6
-rw-r--r--daemon.py10
-rw-r--r--db.py26
-rw-r--r--debugger.py2
-rw-r--r--fileutils.py16
-rw-r--r--graph.py2
-rw-r--r--logging_ext.py4
-rw-r--r--modutils.py8
-rw-r--r--optik_ext.py4
-rw-r--r--optparser.py2
-rw-r--r--proc.py8
-rw-r--r--pytest.py20
-rw-r--r--shellutils.py2
-rw-r--r--sqlgen.py12
-rw-r--r--table.py4
-rw-r--r--testlib.py12
-rw-r--r--textutils.py20
-rw-r--r--tree.py6
-rw-r--r--umessage.py2
-rw-r--r--ureports/__init__.py2
-rw-r--r--ureports/nodes.py2
-rw-r--r--visitor.py2
-rw-r--r--xmlutils.py8
31 files changed, 124 insertions, 124 deletions
diff --git a/ChangeLog b/ChangeLog
index 2514e89..67ebb61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -172,7 +172,7 @@ ChangeLog for logilab.common
2008-09-10 -- 0.35.0
- * fix #5945: wrong edge proporties in graph.DotBackend
+ * fix #5945: wrong edge properties in graph.DotBackend
* testlib: filter tests with tag decorator
@@ -186,7 +186,7 @@ ChangeLog for logilab.common
* testlib: add a with_tempdir decorator ensuring all temporary files and dirs are removed
* graph: improve DotBackend configuration. graphiz rendered can now be selected
- and additionnal graph parameter used
+ and additional graph parameter used
* db: support of Decimal Type
@@ -202,7 +202,7 @@ ChangeLog for logilab.common
- added assertIsNot, assertNone and assertNotNone assertion
- added assertUnorderedIterableEquals
- added assertDirEquals
- - various failure ouput improvement
+ - various failure output improvement
* umessage: umessage.date() may return unparsable string as is instead of None
@@ -213,7 +213,7 @@ ChangeLog for logilab.common
2008-06-08 -- 0.32.0
- * textutils: add the apply_unit fonction
+ * textutils: add the apply_unit function
* testlib:
- added a assertXMLEqualsTuple test assertion
@@ -233,7 +233,7 @@ ChangeLog for logilab.common
2008-03-26 -- 0.30.0
* db: remember logged user on the connection
- * clcommands: commands may be hidden (eg not displayed in help), generic
+ * clcommands: commands may be hidden (e.g. not displayed in help), generic
ListCommandsCommand useful to build bash completion helpers
* changelog: module to parse ChangeLog file as this one, backported from
@@ -256,7 +256,7 @@ ChangeLog for logilab.common
2008-02-18 -- 0.28.2
- * testlib: restore python2.3 compatiblity
+ * testlib: restore python2.3 compatibility
@@ -382,7 +382,7 @@ ChangeLog for logilab.common
* fix textutils test
- * fix a bug which provoqued a crash if devtools was not installed
+ * fix a bug which provoked a crash if devtools was not installed
@@ -544,7 +544,7 @@ ChangeLog for logilab.common
* new clcommands module to handle commands based command line tool
(based on the configuration module)
- * new "date" otion type in optik_ext
+ * new "date" option type in optik_ext
* new AttrObject in testlib to create objects in test with arbitrary attributes
@@ -604,7 +604,7 @@ ChangeLog for logilab.common
* db: add missing port handling to get_connection function and
dbapimodule.connect methods
- * testlib: various fixes and minor improvments
+ * testlib: various fixes and minor improvements
@@ -793,7 +793,7 @@ ChangeLog for logilab.common
2005-01-04 -- 0.8.0
* modutils: a lot of fixes/rewrite on various functions to avoid
unnecessary imports, sys.path pollution, and other bugs (notably
- making plylint reporting wrong modules name/path)
+ making pylint reporting wrong modules name/path)
* astng: new "inspector" module, initially taken from pyreverse code
(http://www.logilab.org/projects/pyreverse), miscellaneous bug fixes
@@ -822,7 +822,7 @@ ChangeLog for logilab.common
2004-10-11 -- 0.7.0
* astng: new methods on the manager, returning astng with nodes for
- packages (ie recursive structure instead of the flat one), with
+ packages (i.e. recursive structure instead of the flat one), with
automatic lazy loading + introduction of a dict like interface to
manipulate those nodes and Module, Class and Function nodes.
@@ -884,9 +884,9 @@ ChangeLog for logilab.common
* astng: resolve(name) now handle (at least try) builtins
- * astng: fixed Class.as_string (empty paren when no base classes)
+ * astng: fixed Class.as_string (empty parent when no base classes)
- * astng.builder: knows a litle about method descriptors, Functin with
+ * astng.builder: knows a little about method descriptors, Function with
unknown arguments have argnames==None.
* fileutils: new is_binary(filename) function
@@ -897,7 +897,7 @@ ChangeLog for logilab.common
* testlib: removed the spawn function (who used that ?!), added MockSMTP,
MockConfigParser, MockConnexion and DocTestCase (test class for
- modules embeding doctest). All mocks objects are very basic and will be
+ modules embedding doctest). All mocks objects are very basic and will be
enhanced as the need comes.
* testlib: added a TestCase class with some additional methods then
@@ -996,10 +996,10 @@ ChangeLog for logilab.common
2003-10-08 -- 0.3.4
- * fix bug in asntg, occuring with python2.3 and modules including an
+ * fix bug in asntg, occurring with python2.3 and modules including an
encoding declaration
- * fix bug in astutils.get_rhs_consumed_names, occuring in lists
+ * fix bug in astutils.get_rhs_consumed_names, occurring in lists
comprehension
* remove debug print statement from configuration.py which caused a
diff --git a/README b/README
index 6a816e9..4c2075f 100644
--- a/README
+++ b/README
@@ -40,7 +40,7 @@ Here is a brief description of the available modules :
* bind.py :
Deprecated module.
Provides a way to optimize globals in certain functions by binding
- their names to values provided in a dictionnary.
+ their names to values provided in a dictionary.
* cache.py :
A cache implementation with a least recently used algorithm.
@@ -61,7 +61,7 @@ Here is a brief description of the available modules :
(using optik/optparse) and configuration file.
* corbautils.py:
- Usefull functions for use with the OmniORB CORBA library.
+ Useful functions for use with the OmniORB CORBA library.
* daemon.py :
A daemon mix-in class.
diff --git a/adbh.py b/adbh.py
index b0047b7..377ea29 100644
--- a/adbh.py
+++ b/adbh.py
@@ -93,13 +93,13 @@ class RANDOM(FunctionDescr):
class _GenericAdvFuncHelper:
"""Generic helper, trying to provide generic way to implement
- specific functionnalities from others DBMS
+ specific functionalities from others DBMS
An exception is raised when the functionality is not emulatable
"""
# DBMS resources descriptors and accessors
- backend_name = None # overriden in subclasses ('postgres', 'sqlite', etc.)
+ backend_name = None # overridden in subclasses ('postgres', 'sqlite', etc.)
needs_from_clause = False
union_parentheses_support = True
intersect_all_support = True
@@ -110,7 +110,7 @@ class _GenericAdvFuncHelper:
case_sensitive = False
FUNCTIONS = {
- # aggregat functions
+ # aggregate functions
'MIN': MIN, 'MAX': MAX,
'SUM': SUM,
'COUNT': COUNT,
@@ -403,7 +403,7 @@ class _PGAdvFuncHelper(_GenericAdvFuncHelper):
class _SqliteAdvFuncHelper(_GenericAdvFuncHelper):
"""Generic helper, trying to provide generic way to implement
- specific functionnalities from others DBMS
+ specific functionalities from others DBMS
An exception is raised when the functionality is not emulatable
"""
diff --git a/cache.py b/cache.py
index 29dc04d..42e4f6c 100644
--- a/cache.py
+++ b/cache.py
@@ -14,7 +14,7 @@ from logilab.common.decorators import locked
_marker = object()
class Cache(dict):
- """A dictionnary like cache.
+ """A dictionary like cache.
inv:
len(self._usage) <= self.size
@@ -45,7 +45,7 @@ class Cache(dict):
self._usage.remove(key)
except ValueError:
# we are inserting a new key
- # check the size of the dictionnary
+ # check the size of the dictionary
# and remove the oldest item in the cache
if self.size and len(self._usage) >= self.size:
super(Cache, self).__delitem__(self._usage[0])
diff --git a/changelog.py b/changelog.py
index 7994a58..ebec9fb 100644
--- a/changelog.py
+++ b/changelog.py
@@ -9,7 +9,7 @@ Sample ChangeLog format::
==========================
--
- * add a new functionnality
+ * add a new functionality
2002-02-01 -- 0.1.1
* fix bug #435454
@@ -66,7 +66,7 @@ class Version(tuple):
# upstream change log #########################################################
class ChangeLogEntry(object):
- """a change log entry, ie a set of messages associated to a version and
+ """a change log entry, i.e. a set of messages associated to a version and
its release date
"""
version_class = Version
@@ -100,7 +100,7 @@ class ChangeLogEntry(object):
if key is None:
self.messages[-1][1].append([sub_msg])
else:
- raise NotImplementedError("sub message to specific key are not impemented yet")
+ raise NotImplementedError("sub message to specific key are not implemented yet")
def write(self, stream=sys.stdout):
"""write the entry to file """
@@ -139,7 +139,7 @@ class ChangeLog(object):
def get_entry(self, version='', create=None):
""" return a given changelog entry
- if version is omited, return the current entry
+ if version is omitted, return the current entry
"""
if not self.entries:
if version or not create:
diff --git a/clcommands.py b/clcommands.py
index fe190f2..5683cf8 100644
--- a/clcommands.py
+++ b/clcommands.py
@@ -81,7 +81,7 @@ def register_commands(commands):
def main_usage(status=0, __doc__=DEFAULT_DOC, copyright=DEFAULT_COPYRIGHT):
- """display usage for the main program (ie when no command supplied)
+ """display usage for the main program (i.e. when no command supplied)
and exit
"""
commands = _COMMANDS.keys()
diff --git a/cli.py b/cli.py
index a17266b..e03a478 100644
--- a/cli.py
+++ b/cli.py
@@ -51,7 +51,7 @@ def init_readline(complete_method, histfile=None):
import atexit
atexit.register(readline.write_history_file, histfile)
except:
- print 'readline si not available :-('
+ print 'readline is not available :-('
class Completer :
@@ -119,7 +119,7 @@ class CLIHelper:
def handle_line(self, stripped_line):
"""Method to overload in the concrete class (should handle
- lines wich are not commands).
+ lines which are not commands).
"""
raise NotImplementedError()
diff --git a/compat.py b/compat.py
index 4e24620..ad0e63a 100644
--- a/compat.py
+++ b/compat.py
@@ -69,7 +69,7 @@ except NameError:
return iter(self._data)
class frozenset(_baseset):
- """immutable set (can be set in dictionnaries)"""
+ """immutable set (can be set in dictionaries)"""
def __init__(self, values=()):
super(frozenset, self).__init__(values)
self._hashcode = None
@@ -107,10 +107,10 @@ except NameError:
return self._data.popitem()[0]
def __hash__(self):
- """mutable et cannot be hashed."""
+ """mutable set cannot be hashed."""
raise TypeError("set objects are not hashable")
- del _baseset # don't explicity provide this class
+ del _baseset # don't explicitly provide this class
try:
from itertools import izip, chain, imap
diff --git a/configuration.py b/configuration.py
index 539fa9c..6172c5c 100644
--- a/configuration.py
+++ b/configuration.py
@@ -369,7 +369,7 @@ class OptionsManagerMixIn(object):
self.reset_parsers(usage, version=version)
# list of registered options providers
self.options_providers = []
- # dictionary assocating option name to checker
+ # dictionary associating option name to checker
self._all_options = {}
self._short_options = {}
self._nocallback_options = {}
@@ -534,7 +534,7 @@ class OptionsManagerMixIn(object):
self.load_config_file()
def read_config_file(self, config_file=None):
- """read the configuration file but do not load it (ie dispatching
+ """read the configuration file but do not load it (i.e. dispatching
values to each options provider)
"""
if config_file is None:
@@ -554,7 +554,7 @@ class OptionsManagerMixIn(object):
return
def input_config(self, onlysection=None, inputlevel=0, stream=None):
- """interactivly get configuration values by asking to the user and generate
+ """interactively get configuration values by asking to the user and generate
a configuration file
"""
if onlysection is not None:
diff --git a/daemon.py b/daemon.py
index a597541..7c3a0c2 100644
--- a/daemon.py
+++ b/daemon.py
@@ -34,14 +34,14 @@ If it i not the case, remove the file %s''' % (self.name, self._pid_file))
# fork so the parent can exist
if (os.fork()):
return -1
- # deconnect from tty and create a new session
+ # disconnect from tty and create a new session
os.setsid()
# fork again so the parent, (the session group leader), can exit.
# as a non-session group leader, we can never regain a controlling
# terminal.
if (os.fork()):
return -1
- # move to the root to avoit mount pb
+ # move to the root to avoid mount pb
os.chdir('/')
# set paranoid umask
os.umask(077)
@@ -58,8 +58,8 @@ If it i not the case, remove the file %s''' % (self.name, self._pid_file))
signal.signal(signal.SIGHUP, self.signal_handler)
def run(self):
- """ optionaly go in daemon mode and
- do what concrete classe has to do and pauses for delay between runs
+ """ optionally go in daemon mode and
+ do what concrete class has to do and pauses for delay between runs
If self.delay is negative, do a pause before starting
"""
if self._daemonize() == -1:
@@ -101,7 +101,7 @@ If it i not the case, remove the file %s''' % (self.name, self._pid_file))
reload(self.config)
def _run(self):
- """should be overidden in the mixed class"""
+ """should be overridden in the mixed class"""
raise NotImplementedError()
## command line utilities ######################################################
diff --git a/db.py b/db.py
index c47aac1..79a3abb 100644
--- a/db.py
+++ b/db.py
@@ -42,10 +42,10 @@ __all__ = ['get_dbapi_compliant_module',
]
class UnknownDriver(Exception):
- """raised when a unknown driver is given to get connexion"""
+ """raised when a unknown driver is given to get connection"""
class NoAdapterFound(Exception):
- """Raised when no Adpater to DBAPI was found"""
+ """Raised when no Adapter to DBAPI was found"""
def __init__(self, obj, objname=None, protocol='DBAPI'):
if objname is None:
objname = obj.__name__
@@ -164,7 +164,7 @@ class PyCursor:
## Adapters list ##############################################################
class DBAPIAdapter:
- """Base class for all DBAPI adpaters"""
+ """Base class for all DBAPI adapters"""
UNKNOWN = None
def __init__(self, native_module, pywrap=False):
@@ -174,7 +174,7 @@ class DBAPIAdapter:
"""
self._native_module = native_module
self._pywrap = pywrap
- # optimisation: copy type codes from the native module to this instance
+ # optimization: copy type codes from the native module to this instance
# since the .process_value method may be heavily used
for typecode in ('STRING', 'BOOLEAN', 'BINARY', 'DATETIME', 'NUMBER',
'UNKNOWN'):
@@ -219,7 +219,7 @@ class DBAPIAdapter:
elif typecode == self.BINARY and not binarywrap is None:
return binarywrap(value)
elif typecode == self.UNKNOWN:
- # may occurs on constant selection for instance (eg SELECT 'hop')
+ # may occurs on constant selection for instance (e.g. SELECT 'hop')
# with postgresql at least
if isinstance(value, str):
return unicode(value, encoding, 'replace')
@@ -259,7 +259,7 @@ class _PsycopgAdapter(DBAPIAdapter):
"""Simple Psycopg Adapter to DBAPI (cnx_string differs from classical ones)
"""
def connect(self, host='', database='', user='', password='', port=''):
- """Handles psycopg connexion format"""
+ """Handles psycopg connection format"""
if host:
cnx_string = 'host=%s dbname=%s user=%s' % (host, database, user)
else:
@@ -316,7 +316,7 @@ class _PgsqlAdapter(DBAPIAdapter):
"""Simple pyPgSQL Adapter to DBAPI
"""
def connect(self, host='', database='', user='', password='', port=''):
- """Handles psycopg connexion format"""
+ """Handles psycopg connection format"""
kwargs = {'host' : host, 'port': port or None,
'database' : database,
'user' : user, 'password' : password or None}
@@ -421,7 +421,7 @@ class _PySqlite2Adapter(DBAPIAdapter):
def connect(self, host='', database='', user='', password='', port=None):
- """Handles sqlite connexion format"""
+ """Handles sqlite connection format"""
sqlite = self._native_module
class PySqlite2Cursor(sqlite.Cursor):
@@ -471,7 +471,7 @@ class _SqliteAdapter(DBAPIAdapter):
self.DATETIME = native_module.TIMESTAMP
def connect(self, host='', database='', user='', password='', port=''):
- """Handles sqlite connexion format"""
+ """Handles sqlite connection format"""
cnx = self._native_module.connect(database)
return self._wrap_if_needed(cnx, user)
@@ -506,7 +506,7 @@ class _MySqlDBAdapter(DBAPIAdapter):
def connect(self, host='', database='', user='', password='', port=None,
unicode=True, charset='utf8'):
- """Handles mysqldb connexion format
+ """Handles mysqldb connection format
the unicode named argument asks to use Unicode objects for strings
in result sets and query parameters
"""
@@ -629,11 +629,11 @@ del _AdapterDirectory
## Main functions #############################################################
def set_prefered_driver(database, module, _drivers=PREFERED_DRIVERS):
- """sets the prefered driver module for database
+ """sets the preferred driver module for database
database is the name of the db engine (postgresql, mysql...)
module is the name of the module providing the connect function
syntax is (params_func, post_process_func_or_None)
- _drivers is a optionnal dictionnary of drivers
+ _drivers is a optional dictionary of drivers
"""
try:
modules = _drivers[database]
@@ -663,7 +663,7 @@ def get_dbapi_compliant_module(driver, prefered_drivers = None, quiet = False,
def get_connection(driver='postgres', host='', database='', user='',
password='', port='', quiet=False, drivers=PREFERED_DRIVERS,
pywrap=False):
- """return a db connexion according to given arguments"""
+ """return a db connection according to given arguments"""
module, modname = _import_driver_module(driver, drivers, ['connect'])
try:
adapter = ADAPTER_DIRECTORY.get_adapter(driver, modname)
diff --git a/debugger.py b/debugger.py
index 567c738..53a7bd9 100644
--- a/debugger.py
+++ b/debugger.py
@@ -153,7 +153,7 @@ class Debugger(Pdb):
ret = ret + self.get_class_members(base)
return ret
- ## specific / overidden commands
+ ## specific / overridden commands
def do_list(self, arg):
"""overrides default list command to display the surrounding block
instead of 5 lines of context
diff --git a/fileutils.py b/fileutils.py
index 177c604..6ddd4ca 100644
--- a/fileutils.py
+++ b/fileutils.py
@@ -71,7 +71,7 @@ def is_binary(filename):
:rtype: bool
:return:
true if the file is a binary file (actually if it's mime type
- isn't begining by text/)
+ isn't beginning by text/)
"""
try:
return not mimetypes.guess_type(filename)[0].startswith('text')
@@ -125,7 +125,7 @@ class ProtectedFile(file):
- if IOError, then create a StringIO object
- - each write operation writes in this StringIO obejct
+ - each write operation writes in this StringIO object
- on close()/del(), write/append the StringIO content to the file and
do the chmod only once
@@ -162,7 +162,7 @@ class UnresolvableError(Exception):
"""
def relative_path(from_file, to_file):
- """Try to get a relative path from from `from_file` to `to_file`
+ """Try to get a relative path from `from_file` to `to_file`
(path will be absolute if to_file is an absolute file). This function
is useful to create link in `from_file` to `to_file`. This typical use
case is used in this function description.
@@ -270,7 +270,7 @@ def lines(path, comments=None):
:type comments: str or None
:param comments:
optional string which can be used to comment a line in the file
- (ie lines starting with this string won't be returned)
+ (i.e. lines starting with this string won't be returned)
:rtype: list
:return:
@@ -294,7 +294,7 @@ def stream_lines(stream, comments=None):
:type comments: str or None
:param comments:
optional string which can be used to comment a line in the file
- (ie lines starting with this string won't be returned)
+ (i.e. lines starting with this string won't be returned)
:rtype: list
:return:
@@ -340,7 +340,7 @@ def export(from_dir, to_dir,
:type verbose: bool
:param verbose:
- flag indicating wether information about exported files should be
+ flag indicating whether information about exported files should be
printed to stderr, default to False
"""
def make_mirror(_, directory, fnames):
@@ -375,14 +375,14 @@ def export(from_dir, to_dir,
def remove_dead_links(directory, verbose=0):
- """Recursivly traverse directory and remove all dead links.
+ """Recursively traverse directory and remove all dead links.
:type directory: str
:param directory: directory to cleanup
:type verbose: bool
:param verbose:
- flag indicating wether information about deleted links should be
+ flag indicating whether information about deleted links should be
printed to stderr, default to False
"""
def _remove_dead_link(_, directory, fnames):
diff --git a/graph.py b/graph.py
index c81887e..573a1ba 100644
--- a/graph.py
+++ b/graph.py
@@ -1,4 +1,4 @@
-"""Graph manipuliation utilities.
+"""Graph manipulation utilities.
(dot generation adapted from pypy/translator/tool/make_dot.py)
diff --git a/logging_ext.py b/logging_ext.py
index 5a27d05..9b7b7d5 100644
--- a/logging_ext.py
+++ b/logging_ext.py
@@ -16,7 +16,7 @@ from logilab.common.textutils import colorize_ansi
def set_log_methods(cls, logger):
- """bind standart logger's methods as methods on the class"""
+ """bind standard logger's methods as methods on the class"""
cls.__logger = logger
for attr in ('debug', 'info', 'warning', 'error', 'critical', 'exception'):
setattr(cls, attr, getattr(logger, attr))
@@ -33,7 +33,7 @@ class ColorFormatter(logging.Formatter):
By default, colorize CRITICAL and ERROR in red, WARNING in orange, INFO in
green and DEBUG in yellow.
- self.colors is customizable via the 'color' constructor argument (dictionnary).
+ self.colors is customizable via the 'color' constructor argument (dictionary).
self.colorfilters is a list of functions that get the LogRecord
and return a color name or None.
diff --git a/modutils.py b/modutils.py
index 837d2b0..302f36c 100644
--- a/modutils.py
+++ b/modutils.py
@@ -188,7 +188,7 @@ def modpath_from_file(filename, extrapath=None):
:type extrapath: dict
:param extrapath:
optional extra search path, with path as key and package name for the path
- as value. This is usually useful to handle package splited in multiple
+ as value. This is usually useful to handle package splitted in multiple
directories using __path__ trick.
@@ -222,7 +222,7 @@ def modpath_from_file(filename, extrapath=None):
def file_from_modpath(modpath, path=None, context_file=None):
- """given a mod path (ie splited module / package name), return the
+ """given a mod path (i.e. splitted module / package name), return the
corresponding file, giving priority to source file over precompiled
file if it exists
@@ -518,7 +518,7 @@ def is_relative(modname, from_file):
:rtype: bool
:return:
- true if the module has been imported relativly to `from_file`
+ true if the module has been imported relatively to `from_file`
"""
if not isdir(from_file):
from_file = dirname(from_file)
@@ -534,7 +534,7 @@ def is_relative(modname, from_file):
# internal only functions #####################################################
def _file_from_modpath(modpath, path=None, context=None):
- """given a mod path (ie splited module / package name), return the
+ """given a mod path (i.e. splitted module / package name), return the
corresponding file
this function is used internally, see `file_from_modpath`'s
diff --git a/optik_ext.py b/optik_ext.py
index 7305b7b..34dbfe9 100644
--- a/optik_ext.py
+++ b/optik_ext.py
@@ -110,7 +110,7 @@ def check_yn(option, opt, value):
def check_named(option, opt, value):
"""check a named value
- return a dictionnary containing (name, value) associations
+ return a dictionary containing (name, value) associations
"""
if isinstance(value, dict):
return value
@@ -165,7 +165,7 @@ def check_color(option, opt, value):
return value
# Else : not a color label neither a valid hexadecimal form => error
msg = "option %s: invalid color : %r, should be either hexadecimal \
- value or predefinied color"
+ value or predefined color"
raise OptionValueError(msg % (opt, value))
def check_time(option, opt, value):
diff --git a/optparser.py b/optparser.py
index 2602a3c..e5b0fd7 100644
--- a/optparser.py
+++ b/optparser.py
@@ -57,7 +57,7 @@ class OptionParser(optparse.OptionParser):
elif self.version is not None and cmd == "--version":
self.print_version()
sys.exit(0)
- self.error('unknow command')
+ self.error('unknown command')
self.prog = '%s %s' % (self.prog, cmd)
mod_or_f, help = self._commands[cmd]
# optparse inserts self.description between usage and options help
diff --git a/proc.py b/proc.py
index d6e8923..bc5d145 100644
--- a/proc.py
+++ b/proc.py
@@ -86,7 +86,7 @@ class ProcInfoLoader:
self._loaded = {}
def list_pids(self):
- """return a list of existant process ids"""
+ """return a list of existent process ids"""
for subdir in os.listdir('/proc'):
if subdir.isdigit():
yield int(subdir)
@@ -118,15 +118,15 @@ class ProcInfoLoader:
try:
class ResourceError(BaseException):
"""Error raise when resource limit is reached"""
- limit = "Unknow Resource Limit"
+ limit = "Unknown Resource Limit"
except NameError:
class ResourceError(Exception):
"""Error raise when resource limit is reached"""
- limit = "Unknow Resource Limit"
+ limit = "Unknown Resource Limit"
class XCPUError(ResourceError):
- """Error raised when CPU Time limite is reached"""
+ """Error raised when CPU Time limit is reached"""
limit = "CPU Time"
class LineageMemoryError(ResourceError):
diff --git a/pytest.py b/pytest.py
index d31410f..e61cfb4 100644
--- a/pytest.py
+++ b/pytest.py
@@ -68,7 +68,7 @@ With those tag::
def titi(test):
pass
-you can filter the function with a simpe python expression
+you can filter the function with a simple python expression
* ``toto`` and ``titi`` match ``rouge``
@@ -317,7 +317,7 @@ def remove_local_modules_from_sys(testdir):
# this is the case of some built-in modules like sys, imp, marshal
continue
modfile = mod.__file__
- # if modfile is not an asbolute path, it was probably loaded locally
+ # if modfile is not an absolute path, it was probably loaded locally
# during the tests
if not osp.isabs(modfile) or modfile.startswith(testdir):
del sys.modules[modname]
@@ -325,7 +325,7 @@ def remove_local_modules_from_sys(testdir):
class PyTester(object):
- """encaspulates testrun logic"""
+ """encapsulates testrun logic"""
def __init__(self, cvg, options):
self.report = GlobalTestReport()
@@ -341,7 +341,7 @@ class PyTester(object):
print self.report
def get_errcode(self):
- # errcode set explicity
+ # errcode set explicitly
if self._errcode is not None:
return self._errcode
return self.report.failures + self.report.errors
@@ -351,7 +351,7 @@ class PyTester(object):
errcode = property(get_errcode, set_errcode)
def testall(self, exitfirst=False):
- """walks trhough current working directory, finds something
+ """walks through current working directory, finds something
which can be considered as a testdir and runs every test there
"""
here = os.getcwd()
@@ -433,7 +433,7 @@ succeeded test file :", osp.join(os.getcwd(),testlib.FILE_RESTART)
return None
except Exception:
self.report.failed_to_test_module(filename)
- print >> sys.stderr, 'unhandled exception occured while testing', modname
+ print >> sys.stderr, 'unhandled exception occurred while testing', modname
import traceback
traceback.print_exc(file=sys.stderr)
return None
@@ -490,7 +490,7 @@ class DjangoTester(PyTester):
def testall(self, exitfirst=False):
- """walks trhough current working directory, finds something
+ """walks through current working directory, finds something
which can be considered as a testdir and runs every test there
"""
for dirname, dirs, _ in os.walk(os.getcwd()):
@@ -511,7 +511,7 @@ class DjangoTester(PyTester):
def testonedir(self, testdir, exitfirst=False):
"""finds each testfile in the `testdir` and runs it"""
- # special django behaviour : if tests are splited in several files,
+ # special django behaviour : if tests are splitted in several files,
# remove the main tests.py file and tests each test file separately
testfiles = [fpath for fpath in abspath_listdir(testdir)
if this_is_a_testfile(fpath)]
@@ -556,7 +556,7 @@ class DjangoTester(PyTester):
import traceback
traceback.print_exc()
self.report.failed_to_test_module(filename)
- print 'unhandled exception occured while testing', modname
+ print 'unhandled exception occurred while testing', modname
print 'error: %s' % exc
return None
finally:
@@ -633,7 +633,7 @@ def make_parser():
parser.add_option('-P', '--profile', default=None, dest='profile',
help="Profile execution and store data in the given file")
parser.add_option('-m', '--match', default=None, dest='tags_pattern',
- help="only execute test whose tag macht the current pattern")
+ help="only execute test whose tag match the current pattern")
try:
from logilab.devtools.lib.coverage import Coverage
diff --git a/shellutils.py b/shellutils.py
index 23a1723..b9f6253 100644
--- a/shellutils.py
+++ b/shellutils.py
@@ -93,7 +93,7 @@ def cp(source, destination):
mv(source, destination, _action=shutil.copy)
def find(directory, exts, exclude=False, blacklist=STD_BLACKLIST):
- """Recursivly find files ending with the given extensions from the directory.
+ """Recursively find files ending with the given extensions from the directory.
:type directory: str
:param directory:
diff --git a/sqlgen.py b/sqlgen.py
index 747bac9..0fd756a 100644
--- a/sqlgen.py
+++ b/sqlgen.py
@@ -46,7 +46,7 @@ class SQLGenerator :
def insert(self, table, params) :
"""
:param table: name of the table
- :param params: dictionnary that will be used as in cursor.execute(sql,params)
+ :param params: dictionary that will be used as in cursor.execute(sql,params)
>>> s = SQLGenerator()
>>> s.insert('test',{'nom':'dupont'})
@@ -62,7 +62,7 @@ class SQLGenerator :
def select(self, table, params) :
"""
:param table: name of the table
- :param params: dictionnary that will be used as in cursor.execute(sql,params)
+ :param params: dictionary that will be used as in cursor.execute(sql,params)
>>> s = SQLGenerator()
>>> s.select('test',{})
@@ -82,7 +82,7 @@ class SQLGenerator :
"""
:param model: list of columns to select
:param tables: list of tables used in from
- :param params: dictionnary that will be used as in cursor.execute(sql, params)
+ :param params: dictionary that will be used as in cursor.execute(sql, params)
:param joins: optional list of restriction statements to insert in the
where clause. Usually used to perform joins.
@@ -104,7 +104,7 @@ class SQLGenerator :
def delete(self, table, params) :
"""
:param table: name of the table
- :param params: dictionnary that will be used as in cursor.execute(sql,params)
+ :param params: dictionary that will be used as in cursor.execute(sql,params)
>>> s = SQLGenerator()
>>> s.delete('test',{'nom':'dupont'})
@@ -119,7 +119,7 @@ class SQLGenerator :
def update(self, table, params, unique) :
"""
:param table: name of the table
- :param params: dictionnary that will be used as in cursor.execute(sql,params)
+ :param params: dictionary that will be used as in cursor.execute(sql,params)
>>> s = SQLGenerator()
>>> s.update('test', {'id':'001','nom':'dupont'}, ['id'])
@@ -202,7 +202,7 @@ class BaseTable:
def name_fields(cursor, records) :
"""
Take a cursor and a list of records fetched with that cursor, then return a
- list of dictionnaries (one for each record) whose keys are column names and
+ list of dictionaries (one for each record) whose keys are column names and
values are records' values.
:param cursor: cursor used to execute the query
diff --git a/table.py b/table.py
index 865087f..9b5b310 100644
--- a/table.py
+++ b/table.py
@@ -105,7 +105,7 @@ class Table(object):
def groupby(self, colname, *others):
"""builds indexes of data
- :returns: nested dictionnaries pointing to actual rows
+ :returns: nested dictionaries pointing to actual rows
"""
groups = {}
colnames = (colname,) + others
@@ -418,7 +418,7 @@ class Table(object):
"""returns a string representing the table in a pretty
printed 'text' format.
"""
- # The maxium row name (to know the start_index of the first col)
+ # The maximum row name (to know the start_index of the first col)
max_row_name = 0
for row_name in self.row_names:
if len(row_name) > max_row_name:
diff --git a/testlib.py b/testlib.py
index f19d6d1..c3d8496 100644
--- a/testlib.py
+++ b/testlib.py
@@ -113,7 +113,7 @@ def run_tests(tests, quiet, verbose, runner=None, capture=0):
print "Executing", test
result = run_test(test, verbose, runner, capture)
if type(result) is type(''):
- # an unexpected error occured
+ # an unexpected error occurred
skipped.append( (test, result))
else:
if all_result is None:
@@ -769,7 +769,7 @@ Examples:
options=self.options)
def removeSucceededTests(obj, succTests):
- """ Recurcive function that removes succTests from
+ """ Recursive function that removes succTests from
a TestSuite or TestCase
"""
if isinstance(obj, TestSuite):
@@ -905,7 +905,7 @@ def capture_stderr(printonly=None):
def unittest_main(module='__main__', defaultTest=None,
batchmode=False, cvg=None, options=None,
outstream=sys.stderr):
- """use this functon if you want to have the same functionality
+ """use this function if you want to have the same functionality
as unittest.main"""
return SkipAwareTestProgram(module, defaultTest, batchmode,
cvg, options, outstream)
@@ -1339,7 +1339,7 @@ succeeded test into", osp.join(os.getcwd(),FILE_RESTART)
self.fail( "tuple %s has no attributes (%s expected)"%(tup,
dict(element.attrib)))
self.assertDictEquals(element.attrib, tup[1])
- # check childrend
+ # check children
if len(element) or len(tup)>2:
if len(tup)<=2:
self.fail( "tuple %s has no children (%i expected)"%(tup,
@@ -1398,7 +1398,7 @@ succeeded test into", osp.join(os.getcwd(),FILE_RESTART)
# make sure we compare from the beginning of the stream
stream1.seek(0)
stream2.seek(0)
- # ocmpare
+ # compare
self._difftext(stream1.readlines(), stream2.readlines(), junk,
msg_prefix)
@@ -1768,7 +1768,7 @@ class Tags(set):
return eval(exp, {}, self)
def require_version(version):
- """ Compare version of python interpretor to the given one. Skip the test
+ """ Compare version of python interpreter to the given one. Skip the test
if older.
"""
def check_require_version(f):
diff --git a/textutils.py b/textutils.py
index 3c40dda..38f59c7 100644
--- a/textutils.py
+++ b/textutils.py
@@ -18,15 +18,15 @@ unquote, colorize_ansi
:type ANSI_PREFIX: str
:var ANSI_PREFIX:
- ANSI terminal code notifing the start of an ANSI escape sequence
+ ANSI terminal code notifying the start of an ANSI escape sequence
:type ANSI_END: str
:var ANSI_END:
- ANSI terminal code notifing the end of an ANSI escape sequence
+ ANSI terminal code notifying the end of an ANSI escape sequence
:type ANSI_RESET: str
:var ANSI_RESET:
- ANSI terminal code reseting format defined by a previous ANSI escape sequence
+ ANSI terminal code resetting format defined by a previous ANSI escape sequence
"""
__docformat__ = "restructuredtext en"
@@ -77,7 +77,7 @@ def unquote(string):
"""remove optional quotes (simple or double) from the string
:type string: str or unicode
- :param string: an optionaly quoted string
+ :param string: an optionally quoted string
:rtype: str or unicode
:return: the unquoted string (or the input string if it wasn't quoted)
@@ -127,7 +127,7 @@ def normalize_text(text, line_len=80, indent='', rest=False):
def normalize_paragraph(text, line_len=80, indent=''):
"""normalize a text to display it with a maximum line size and
- optionaly arbitrary indentation. Line jumps are normalized. The
+ optionally arbitrary indentation. Line jumps are normalized. The
indentation string may be used top insert a comment mark for
instance.
@@ -156,7 +156,7 @@ def normalize_paragraph(text, line_len=80, indent=''):
def normalize_rest_paragraph(text, line_len=80, indent=''):
"""normalize a ReST text to display it with a maximum line size and
- optionaly arbitrary indentation. Line jumps are normalized. The
+ optionally arbitrary indentation. Line jumps are normalized. The
indentation string may be used top insert a comment mark for
instance.
@@ -261,7 +261,7 @@ TIME_UNITS = {
def apply_units( string, units, inter=None, final=float, blank_reg=_BLANK_RE,
value_reg=_VALUE_RE):
"""Parse the string applying the units defined in units
- (eg: "1.5m",{'m',60} -> 80).
+ (e.g.: "1.5m",{'m',60} -> 80).
:type string: str or unicode
:param string: the string to parse
@@ -273,7 +273,7 @@ def apply_units( string, units, inter=None, final=float, blank_reg=_BLANK_RE,
:param inter: used to parse every intermediate value (need __sum__)
:type blank_reg: regexp
- :param blank_reg: should match eveyr blank char to ignore.
+ :param blank_reg: should match every blank char to ignore.
:type value_reg: regexp with "value" and optional "unit" group
:param value_reg: match a value and it's unit into the
@@ -387,7 +387,7 @@ def _get_ansi_code(color=None, style=None):
style string (see `ANSI_COLORS` for available values). To get
several style effects at the same time, use a coma as separator.
- :raise KeyError: if an unexistant color or style identifier is given
+ :raise KeyError: if an unexistent color or style identifier is given
:rtype: str
:return: the built escape code
@@ -418,7 +418,7 @@ def colorize_ansi(msg, color=None, style=None):
style string (see `ANSI_COLORS` for available values). To get
several style effects at the same time, use a coma as separator.
- :raise KeyError: if an unexistant color or style identifier is given
+ :raise KeyError: if an unexistent color or style identifier is given
:rtype: str or unicode
:return: the ansi escaped string
diff --git a/tree.py b/tree.py
index 6158457..2085ed1 100644
--- a/tree.py
+++ b/tree.py
@@ -24,7 +24,7 @@ EX_NODE_NOT_FOUND = "No such node as '%s'"
# Base node ###################################################################
class Node(object):
- """a basic tree node, caracterised by an id"""
+ """a basic tree node, characterized by an id"""
def __init__(self, nid=None) :
self.id = nid
@@ -218,7 +218,7 @@ class VNode(Node, VisitedMixIn):
class BinaryNode(VNode):
- """a binary node (ie only two children
+ """a binary node (i.e. only two children
"""
def __init__(self, lhs=None, rhs=None) :
VNode.__init__(self)
@@ -348,7 +348,7 @@ class PostfixedDepthFirstIterator(FilteredIterator):
FilteredIterator.__init__(self, node, post_order_list, filter_func)
class PrefixedDepthFirstIterator(FilteredIterator):
- """a pretfixed depth first iterator, designed to be used with visitors
+ """a prefixed depth first iterator, designed to be used with visitors
"""
def __init__(self, node, filter_func=None):
FilteredIterator.__init__(self, node, pre_order_list, filter_func)
diff --git a/umessage.py b/umessage.py
index 7766bdd..3715fcd 100644
--- a/umessage.py
+++ b/umessage.py
@@ -113,7 +113,7 @@ class UMessage:
def multi_addrs(self, header):
"""return a list of 2-uple (name, address) for the given address (which
- is exepected to be an header containing address such as from, to, cc...)
+ is expected to be an header containing address such as from, to, cc...)
"""
persons = []
for person in self.get_all(header, ()):
diff --git a/ureports/__init__.py b/ureports/__init__.py
index f58707b..6901bf4 100644
--- a/ureports/__init__.py
+++ b/ureports/__init__.py
@@ -1,6 +1,6 @@
"""Universal report objects and some formatting drivers.
-A way to create simple reports using python objects, primarly designed to be
+A way to create simple reports using python objects, primarily designed to be
formatted as text and html.
:copyright:
diff --git a/ureports/nodes.py b/ureports/nodes.py
index 8992d31..4fded05 100644
--- a/ureports/nodes.py
+++ b/ureports/nodes.py
@@ -102,7 +102,7 @@ class Link(BaseComponent):
class Image(BaseComponent):
- """an embeded or a single image
+ """an embedded or a single image
attributes :
* BaseComponent attributes
diff --git a/visitor.py b/visitor.py
index 3aface4..38aff89 100644
--- a/visitor.py
+++ b/visitor.py
@@ -35,7 +35,7 @@ class Visitor(object):
"""
launch the visit on a given node
- call 'open_visit' before the begining of the visit, with extra args
+ call 'open_visit' before the beginning of the visit, with extra args
given
when all nodes have been visited, call the 'close_visit' method
"""
diff --git a/xmlutils.py b/xmlutils.py
index 5a27f0f..a700945 100644
--- a/xmlutils.py
+++ b/xmlutils.py
@@ -3,7 +3,7 @@
This module contains useful functions for parsing and using XML data. For the
moment, there is only one function that can parse the data inside a processing
-instruction and return a Python dictionnary.
+instruction and return a Python dictionary.
:copyright: 2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
@@ -18,8 +18,8 @@ RE_SIMPLE_QUOTE = re.compile("([\w\-\.]+)='([^']+)'")
def parse_pi_data(pi_data):
"""
- Utilitary function that parses the data contained in an XML
- processing instruction and returns a dictionnary of keywords and their
+ Utility function that parses the data contained in an XML
+ processing instruction and returns a dictionary of keywords and their
associated values (most of the time, the processing instructions contain
data like ``keyword="value"``, if a keyword is not associated to a value,
for example ``keyword``, it will be associated to ``None``).
@@ -27,7 +27,7 @@ def parse_pi_data(pi_data):
:param pi_data: data contained in an XML processing instruction.
:type pi_data: unicode
- :returns: Dictionnary of the keywords (Unicode strings) associated to
+ :returns: Dictionary of the keywords (Unicode strings) associated to
their values (Unicode strings) as they were defined in the
data.
:rtype: dict