From b67e18bcb53c7551c1c6a1056224960e06ae4fe2 Mon Sep 17 00:00:00 2001 From: Andrew Latham Date: Mon, 23 Oct 2017 11:02:19 -0500 Subject: [PATCH] [IMP] tools: basic spelling and grammar corrections Closes #20391 --- odoo/tools/appdirs.py | 4 ++-- odoo/tools/config.py | 6 +++--- odoo/tools/convert.py | 4 ++-- odoo/tools/float_utils.py | 2 +- odoo/tools/graph.py | 6 +++--- odoo/tools/image.py | 4 ++-- odoo/tools/misc.py | 10 +++++----- odoo/tools/osutil.py | 2 +- odoo/tools/parse_version.py | 2 +- odoo/tools/translate.py | 18 +++++++++--------- odoo/tools/yaml_import.py | 2 +- odoo/tools/yaml_tag.py | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/odoo/tools/appdirs.py b/odoo/tools/appdirs.py index 6176e6bce75..5bd5afb11cb 100644 --- a/odoo/tools/appdirs.py +++ b/odoo/tools/appdirs.py @@ -52,7 +52,7 @@ def user_data_dir(appname=None, appauthor=None, version=None, roaming=False): Win 7 (roaming): C:\Users\\AppData\Roaming\\ For Unix, we follow the XDG spec and support $XDG_DATA_HOME. - That means, by deafult "~/.local/share/". + That means, by default "~/.local/share/". """ if sys.platform == "win32": if appauthor is None: @@ -162,7 +162,7 @@ def user_config_dir(appname=None, appauthor=None, version=None, roaming=False): Win *: same as user_data_dir For Unix, we follow the XDG spec and support $XDG_DATA_HOME. - That means, by deafult "~/.local/share/". + That means, by default "~/.local/share/". """ if sys.platform in [ "win32", "darwin" ]: path = user_data_dir(appname, appauthor, None, roaming) diff --git a/odoo/tools/config.py b/odoo/tools/config.py index 1901620cf4e..288e29f4464 100644 --- a/odoo/tools/config.py +++ b/odoo/tools/config.py @@ -219,7 +219,7 @@ class configmanager(object): choices=['disable', 'allow', 'prefer', 'require', 'verify-ca', 'verify-full'], help="specify the database ssl connection mode (see PostgreSQL documentation)") group.add_option("--db_maxconn", dest="db_maxconn", type='int', my_default=64, - help="specify the the maximum number of physical connections to posgresql") + help="specify the the maximum number of physical connections to PostgreSQL") group.add_option("--db-template", dest="db_template", my_default="template1", help="specify a custom database template to create a new database") parser.add_option_group(group) @@ -320,7 +320,7 @@ class configmanager(object): arguments. This method initializes odoo.tools.config and openerp.conf (the - former should be removed in the furture) with library-wide + former should be removed in the future) with library-wide configuration values. This method must be called before proper usage of this library can be @@ -395,7 +395,7 @@ class configmanager(object): if self.options['server_wide_modules'] in ('', 'None', 'False'): self.options['server_wide_modules'] = 'web' - # if defined dont take the configfile value even if the defined value is None + # if defined do not take the configfile value even if the defined value is None keys = ['http_interface', 'http_port', 'longpolling_port', 'http_enable', 'db_name', 'db_user', 'db_password', 'db_host', 'db_sslmode', 'db_port', 'db_template', 'logfile', 'pidfile', 'smtp_port', diff --git a/odoo/tools/convert.py b/odoo/tools/convert.py index 59e87d6ee32..e670d93b80e 100644 --- a/odoo/tools/convert.py +++ b/odoo/tools/convert.py @@ -130,7 +130,7 @@ def _eval_xml(self, node, env): # bytestring of n nuls. In Python 2 it obviously returns the # stringified number, which is what we're expecting here s = s.replace(found, pycompat.text_type(self.idref[id])) - s = s.replace('%%', '%') # Quite wierd but it's for (somewhat) backward compatibility sake + s = s.replace('%%', '%') # Quite weird but it's for (somewhat) backward compatibility sake return s if t == 'xml': @@ -581,7 +581,7 @@ form: module.record_id""" % (xml_id,) ) self._test_xml_id(rec_id) - # in update mode, the record won't be updated if the data node explicitely + # in update mode, the record won't be updated if the data node explicitly # opt-out using @noupdate="1". A second check will be performed in # ir.model.data#_update() using the record's ir.model.data `noupdate` field. if self.isnoupdate(data_node) and self.mode != 'init': diff --git a/odoo/tools/float_utils.py b/odoo/tools/float_utils.py index bf3f0463c0a..33044d21f93 100644 --- a/odoo/tools/float_utils.py +++ b/odoo/tools/float_utils.py @@ -168,7 +168,7 @@ def float_repr(value, precision_digits): :param int precision_digits: number of fractional digits to include in the output """ - # Can't use str() here because it seems to have an intrisic + # Can't use str() here because it seems to have an intrinsic # rounding to 12 significant digits, which causes a loss of # precision. e.g. str(123456789.1234) == str(123456789.123)!! return ("%%.%sf" % precision_digits) % value diff --git a/odoo/tools/graph.py b/odoo/tools/graph.py index 0f7665f0624..894b7f3bd2b 100755 --- a/odoo/tools/graph.py +++ b/odoo/tools/graph.py @@ -95,7 +95,7 @@ class graph(object): def init_cutvalues(self): - """Initailize cut values of edges of the feasible tree. + """Initialize cut values of edges of the feasible tree. Edges with negative cut-values are removed from the tree to optimize rank assignment """ self.cut_edges = {} @@ -306,7 +306,7 @@ class graph(object): def wmedian(self): - """Applies median heuristic to find optimzed order of the nodes with in their ranks + """Applies median heuristic to find optimized order of the nodes with in their ranks """ for level in self.levels: @@ -541,7 +541,7 @@ class graph(object): self.max_order = max(x['y'] for x in self.result.values()) def find_starts(self): - """Finds other start nodes of the graph in the case when graph is disconneted + """Finds other start nodes of the graph in the case when graph is disconnected """ rem_nodes = [] for node in self.nodes: diff --git a/odoo/tools/image.py b/odoo/tools/image.py index fd425ed7791..fec14f0eac4 100644 --- a/odoo/tools/image.py +++ b/odoo/tools/image.py @@ -41,7 +41,7 @@ def image_resize_image(base64_source, size=(1024, 1024), encoding='base64', file :param base64_source: base64-encoded version of the source image; if False, returns False :param size: 2-tuple(width, height). A None value for any of width or - height mean an automatically computed value based respectivelly + height mean an automatically computed value based respectively on height or width of the source image. :param encoding: the output encoding :param filetype: the output filetype, by default the source image's @@ -245,7 +245,7 @@ def image_get_resized_images(base64_source, return_big=False, return_medium=True only image_medium and image_small values, to update those fields. :param base64_source: base64-encoded version of the source - image; if False, all returnes values will be False + image; if False, all returned values will be False :param return_{..}: if set, computes and return the related resizing of the image :param {..}_name: key of the resized image in the return dictionary; diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index 49f8024c5ed..1da410c6b74 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -252,7 +252,7 @@ def _fileopen(path, mode, basedir, pathinfo, basename=None): pass # Not found if name.endswith('.rml'): - raise IOError('Report %r doesn\'t exist or deleted' % basename) + raise IOError('Report %r does not exist or has been deleted' % basename) raise IOError('File not found: %s' % basename) @@ -260,7 +260,7 @@ def _fileopen(path, mode, basedir, pathinfo, basename=None): # iterables #---------------------------------------------------------- def flatten(list): - """Flatten a list of elements into a uniqu list + """Flatten a list of elements into a unique list Author: Christophe Simonis (christophe@tinyerp.com) Examples:: @@ -349,7 +349,7 @@ def topological_sort(elems): try: import xlwt - # add some sanitizations to respect the excel sheet name restrictions + # add some sanitization to respect the excel sheet name restrictions # as the sheet name is often translatable, can not control the input class PatchedWorkbook(xlwt.Workbook): def add_sheet(self, name, cell_overwrite_ok=False): @@ -368,7 +368,7 @@ except ImportError: try: import xlsxwriter - # add some sanitizations to respect the excel sheet name restrictions + # add some sanitization to respect the excel sheet name restrictions # as the sheet name is often translatable, can not control the input class PatchedXlsxWorkbook(xlsxwriter.Workbook): @@ -886,7 +886,7 @@ class ConstantMapping(Mapping): def __iter__(self): """ - same as len, defaultdict udpates its iterable keyset with each key + same as len, defaultdict updates its iterable keyset with each key requested, is there a point for this? """ return iter([]) diff --git a/odoo/tools/osutil.py b/odoo/tools/osutil.py index 2bb180a1d17..27d4abd34a8 100644 --- a/odoo/tools/osutil.py +++ b/odoo/tools/osutil.py @@ -33,7 +33,7 @@ def listdir(dir, recursive=False): def walksymlinks(top, topdown=True, onerror=None): """ same as os.walk but follow symlinks - attention: all symlinks are walked before all normals directories + attention: all symlinks are walked before all normal directories """ for dirpath, dirnames, filenames in os.walk(top, topdown, onerror): if topdown: diff --git a/odoo/tools/parse_version.py b/odoo/tools/parse_version.py index e9ff071c0b6..be509a1504f 100644 --- a/odoo/tools/parse_version.py +++ b/odoo/tools/parse_version.py @@ -43,7 +43,7 @@ def parse_version(s): The algorithm assumes that strings like "-" and any alpha string that alphabetically follows "final" represents a "patch level". So, "2.4-1" is assumed to be a branch or patch of "2.4", and therefore "2.4.1" is - considered newer than "2.4-1", whic in turn is newer than "2.4". + considered newer than "2.4-1", which in turn is newer than "2.4". Strings like "a", "b", "c", "alpha", "beta", "candidate" and so on (that come before "final" alphabetically) are assumed to be pre-release versions, diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index 714d0734f56..8ffb9fc06af 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -63,7 +63,7 @@ _LOCALE2WIN32 = { 'hi_IN': 'Hindi', 'hu': 'Hungarian_Hungary', 'is_IS': 'Icelandic_Iceland', - 'id_ID': 'Indonesian_indonesia', + 'id_ID': 'Indonesian_Indonesia', 'it_IT': 'Italian_Italy', 'ja_JP': 'Japanese_Japan', 'kn_IN': 'Kannada', @@ -85,7 +85,7 @@ _LOCALE2WIN32 = { 'sr_CS': 'Serbian (Cyrillic)_Serbia and Montenegro', 'sk_SK': 'Slovak_Slovakia', 'sl_SI': 'Slovenian_Slovenia', - #should find more specific locales for spanish countries, + #should find more specific locales for Spanish countries, #but better than nothing 'es_AR': 'Spanish_Spain', 'es_BO': 'Spanish_Spain', @@ -116,7 +116,7 @@ _LOCALE2WIN32 = { } -# These are not all english small words, just those that could potentially be isolated within views +# These are not all English small words, just those that could potentially be isolated within views ENGLISH_SMALL_WORDS = set("as at by do go if in me no of ok on or to up us we".split()) @@ -410,7 +410,7 @@ class GettextAlias(object): if not lang: # Last resort: attempt to guess the language of the user # Pitfall: some operations are performed in sudo mode, and we - # don't know the originial uid, so the language may + # don't know the original uid, so the language may # be wrong when the admin language differs. (cr, dummy) = self._get_cr(frame, allow_create=False) uid = self._get_uid(frame) @@ -560,8 +560,8 @@ class PoFile(object): if not source and self.first: self.first = False # if the source is "" and it's the first msgid, it's the special - # msgstr with the informations about the traduction and the - # traductor; we skip it + # msgstr with the information about the translate and the + # translator; we skip it self.extra_lines = [] while line: line = self.lines.pop(0).strip() @@ -590,7 +590,7 @@ class PoFile(object): if name is None: if not fuzzy: - _logger.warning('Missing "#:" formated comment at line %d for the following source:\n\t%s', + _logger.warning('Missing "#:" formatted comment at line %d for the following source:\n\t%s', self.cur_line(), source[:30]) return next(self) return trans_type, name, res_id, source, trad, '\n'.join(comments) @@ -638,7 +638,7 @@ class PoFile(object): code = True if code: - # only strings in python code are python formated + # only strings in python code are python formatted self.buffer.write(u"#, python-format\n") msg = ( @@ -1139,7 +1139,7 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True, irt_cursor.finish() Translation.clear_caches() if verbose: - _logger.info("translation file loaded succesfully") + _logger.info("translation file loaded successfully") except IOError: iso_lang = get_iso_codes(lang) diff --git a/odoo/tools/yaml_import.py b/odoo/tools/yaml_import.py index 674047cd22a..b87c3bcf4b4 100644 --- a/odoo/tools/yaml_import.py +++ b/odoo/tools/yaml_import.py @@ -323,7 +323,7 @@ class YamlInterpreter(object): view (either specified on the !record tag or the default one for this object), including the calls to on_change() functions, and sending only values for fields that aren't set as readonly. :param model: model instance (new API) - :param fields: dictonary mapping the field names and their values + :param fields: dictionary mapping the field names and their values :param view_info: result of fields_view_get() called on the object :param parent: dictionary containing the values already computed for the parent, in case of one2many fields :param default: if True, the default values must be processed too or not diff --git a/odoo/tools/yaml_tag.py b/odoo/tools/yaml_tag.py index eb9c6357ae8..86a1e1f7f99 100644 --- a/odoo/tools/yaml_tag.py +++ b/odoo/tools/yaml_tag.py @@ -5,7 +5,7 @@ import logging class YamlTag(object): """ Superclass for constructors of custom tags defined in yaml file. - __str__ is overriden in subclass and used for serialization in module recorder. + __str__ is overridden in subclass and used for serialization in module recorder. """ def __init__(self, **kwargs): self.__dict__.update(kwargs)