Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typos fixed in doit sources. #167

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions doit/action.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Implements actions used by doit tasks
"""Implements actions used by doit tasks
"""

import os
Expand All @@ -12,7 +12,7 @@


def normalize_callable(ref):
"""return a list with (callabe, *args, **kwargs)
"""return a list with (callable, *args, **kwargs)
ref can be a simple callable or a tuple
"""
if isinstance(ref, tuple):
Expand Down Expand Up @@ -67,7 +67,7 @@ def _prepare_kwargs(task, func, args, kwargs):
sig_param = func_sig.parameters[key]

# it is forbidden to use default values for this arguments
# because the user might be unware of this magic.
# because the user might be unaware of this magic.
if (key in meta_args and sig_param.default!=sig_param.empty):
msg = ("Task %s, action %s(): The argument '%s' is not "
"allowed to have a default value (reserved by doit)"
Expand Down Expand Up @@ -142,7 +142,7 @@ def action(self):


def _print_process_output(self, process, input_, capture, realtime):
"""Reads 'input_' untill process is terminated.
"""Reads 'input_' until process is terminated.
Writes 'input_' content to 'capture' (string)
and 'realtime' stream
"""
Expand Down Expand Up @@ -269,7 +269,7 @@ def expand_action(self):
subs_dict['changed'] = " ".join(self.task.dep_changed)
# task option parameters
subs_dict.update(self.task.options)
# convert postional parameters from list space-separated string
# convert positional parameters from list space-separated string
if self.task.pos_arg:
if self.task.pos_arg_val:
pos_val = ' '.join(self.task.pos_arg_val)
Expand Down
12 changes: 6 additions & 6 deletions doit/cmd_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import inspect
import inspect
import sys
from collections import deque

Expand Down Expand Up @@ -45,12 +45,12 @@ class Command(object):
# doc attributes, should be sub-classed
doc_purpose = ''
doc_usage = ''
doc_description = None # None value will completely ommit line from doc
doc_description = None # None value will completely omit line from doc

# sequence of dicts
cmd_options = tuple()

# `execute_tasks` indicates wheather this command execute task's actions.
# `execute_tasks` indicates whether this command execute task's actions.
# This is used by the loader to indicate when delayed task creation
# should be used.
execute_tasks = False
Expand Down Expand Up @@ -104,7 +104,7 @@ def get_options(self):
def execute(self, opt_values, pos_args): # pragma: no cover
"""execute command
:param opt_values: (dict) with cmd_options values
:param pos_args: (list) of cmd-line positinal arguments
:param pos_args: (list) of cmd-line positional arguments
"""
raise NotImplementedError()

Expand Down Expand Up @@ -304,7 +304,7 @@ def _execute(self): # pragma: no cover

@staticmethod
def check_minversion(minversion):
"""check if this version of doit statisfy minimum required version
"""check if this version of doit satisfy minimum required version
Minimum version specified by configuration on dodo.
"""
if minversion:
Expand Down Expand Up @@ -387,7 +387,7 @@ def execute(self, params, args):
# create dep manager
db_class = self._backends.get(params['backend'])
checker_cls = self.get_checker_cls(params['check_file_uptodate'])
# note the command have the responsability to call dep_manager.close()
# note the command have the responsibility to call dep_manager.close()
self.dep_manager = Dependency(db_class, params['dep_file'], checker_cls)

# hack to pass parameter into _execute() calls that are not part
Expand Down
6 changes: 3 additions & 3 deletions doit/cmd_clean.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .cmd_base import DoitCmdBase
from .cmd_base import DoitCmdBase
from .cmd_base import check_tasks_exist, tasks_and_deps_iter, subtasks_iter


Expand Down Expand Up @@ -60,7 +60,7 @@ def _execute(self, dryrun, cleandep, cleanall, pos_args=None):
from cmd-line
"""
tasks = dict([(t.name, t) for t in self.task_list])
# behaviour of cleandep is different if selected_tasks comes from
# behavior of cleandep is different if selected_tasks comes from
# command line or DOIT_CONFIG.default_tasks
selected_tasks = pos_args
check_tasks_exist(tasks, selected_tasks)
Expand All @@ -80,7 +80,7 @@ def _execute(self, dryrun, cleandep, cleanall, pos_args=None):

# include dependencies in list
if cleandep:
# including repeated entries will garantee that deps are listed
# including repeated entries will guarantee that deps are listed
# first when the list is reversed
to_clean = list(tasks_and_deps_iter(tasks, clean_list, True))
# include only subtasks in list
Expand Down
2 changes: 1 addition & 1 deletion doit/cmd_completion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""generate shell script with tab completion code for doit commands/tasks"""
"""generate shell script with tab completion code for doit commands/tasks"""

import sys
from string import Template
Expand Down
4 changes: 2 additions & 2 deletions doit/cmd_help.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .exceptions import InvalidDodoFile
from .exceptions import InvalidDodoFile
from .cmdparse import TaskParse, CmdOption
from .cmd_base import DoitCmdBase

Expand Down Expand Up @@ -156,7 +156,7 @@ def execute(self, params, args):
else:
# help of specific task
try:
# call base class implemention to execute _execute()
# call base class implementation to execute _execute()
if not DoitCmdBase.execute(self, params, args):
self.print_usage(self.cmds)
except InvalidDodoFile:
Expand Down
4 changes: 2 additions & 2 deletions doit/cmd_strace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys
import sys
import os
import re

Expand Down Expand Up @@ -112,7 +112,7 @@ def find_deps(outstream, strace_out, show_all):
# ignore rest of line
# .*\( # ignore text until '('
# "(?P<file>[^"]*)" # get "file" name inside "
# , (\[.*\])* # ignore elments if inside [] - used by execve
# , (\[.*\])* # ignore elements if inside [] - used by execve
# (?P<mode>[^)]*)\) # get mode opening file
# = ].* # check syscall was successful""",
regex = re.compile(r'.*\("(?P<file>[^"]*)",' +
Expand Down
6 changes: 3 additions & 3 deletions doit/cmdparse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Parse command line options and execute it.
"""Parse command line options and execute it.

Built on top of getopt. optparse can't handle sub-commands.
"""
Expand All @@ -14,7 +14,7 @@ class DefaultUpdate(dict):

This is used when you have a dict that has multiple source of values
(i.e. hardcoded, config file, command line). And values are updated
beggining from the source with higher priority.
beginning from the source with higher priority.

A default value is added with the method set_default or add_defaults.
"""
Expand Down Expand Up @@ -133,7 +133,7 @@ def str2boolean(self, str_val):
def str2type(self, str_val):
"""convert string value to option type value"""
try:
# no coversion if value is not a string
# no conversion if value is not a string
if not isinstance(str_val, str):
val = str_val
elif self.type is bool:
Expand Down
8 changes: 4 additions & 4 deletions doit/control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Control tasks execution order"""
"""Control tasks execution order"""
import fnmatch
from collections import deque
from collections import OrderedDict
Expand Down Expand Up @@ -48,7 +48,7 @@ def __init__(self, task_list, auto_delayed_regex=False):

# name of task in order to be executed
# this the order as in the dodo file. the real execution
# order might be different if the dependecies require so.
# order might be different if the dependencies require so.
self._def_order = []
# list of tasks selected to be executed
self.selected_tasks = None
Expand Down Expand Up @@ -266,7 +266,7 @@ def task_dispatcher(self):


class ExecNode(object):
"""Each task will have an instace of this
"""Each task will have an instance of this.
This used to keep track of waiting events and the generator for dep nodes

@ivar run_status (str): contains the result of Dependency.get_status().status
Expand Down Expand Up @@ -420,7 +420,7 @@ def _add_task(self, node):
- None values are of no interest and are filtered out
by the decorator no_none

note that after a 'wait' is sent it is the reponsability of the
note that after a 'wait' is sent it is the responsibility of the
caller to ensure the current ExecNode cleared all its waiting
before calling `next()` again on this generator
"""
Expand Down
22 changes: 11 additions & 11 deletions doit/dependency.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Manage (save/check) task dependency-on-files data."""
"""Manage (save/check) task dependency-on-files data."""

import os
import hashlib
Expand Down Expand Up @@ -106,12 +106,12 @@ def in_(self, task_id):


def remove(self, task_id):
"""remove saved dependecies from DB for taskId"""
"""remove saved dependencies from DB for taskId"""
if task_id in self._db:
del self._db[task_id]

def remove_all(self):
"""remove saved dependecies from DB for all tasks"""
"""remove saved dependencies from DB for all tasks"""
self._db = {}


Expand Down Expand Up @@ -204,7 +204,7 @@ def in_(self, task_id):


def remove(self, task_id):
"""remove saved dependecies from DB for taskId"""
"""remove saved dependencies from DB for taskId"""
if task_id in self._db:
del self._db[task_id]
if self._in_dbm(task_id):
Expand All @@ -214,7 +214,7 @@ def remove(self, task_id):


def remove_all(self):
"""remove saved dependecies from DB for all tasks"""
"""remove saved dependencies from DB for all tasks"""
self._db = {}
# dumb dbm always opens file in update mode
if isinstance(self._dbm, dumb._Database): # pragma: no cover
Expand Down Expand Up @@ -320,15 +320,15 @@ def dump(self):
self._dirty = set()

def remove(self, task_id):
"""remove saved dependecies from DB for taskId"""
"""remove saved dependencies from DB for taskId"""
if task_id in self._cache:
del self._cache[task_id]
if task_id in self._dirty:
self._dirty.remove(task_id)
self._conn.execute('delete from doit where task_id=?', (task_id,))

def remove_all(self):
"""remove saved dependecies from DB for all task"""
"""remove saved dependencies from DB for all task"""
self._conn.execute('delete from doit')
self._cache = {}
self._dirty = set()
Expand All @@ -349,7 +349,7 @@ def check_modified(self, file_path, file_stat, state):
raise NotImplementedError()

def get_state(self, dep, current_state):
"""Compute the state of a task after it has been successfuly executed.
"""Compute the state of a task after it has been successfully executed.

@param dep (str): path of the dependency file.
@param current_state (tuple): the current state, saved from a previous
Expand Down Expand Up @@ -490,7 +490,7 @@ def close(self):
####### task specific

def save_success(self, task, result_hash=None):
"""save info after a task is successfuly executed
"""save info after a task is successfully executed

:param result_hash: (str) explicitly set result_hash
"""
Expand Down Expand Up @@ -570,7 +570,7 @@ def get_status(self, task, tasks_dict, get_log=False):

task.dep_changed (list-strings): file-dependencies that are not
up-to-date if task not up-to-date because of a target, returned value
will contain all file-dependencies reagrdless they are up-to-date
will contain all file-dependencies regardless they are up-to-date
or not.
"""
result = DependencyStatus(get_log)
Expand Down Expand Up @@ -637,7 +637,7 @@ def get_status(self, task, tasks_dict, get_log=False):
if previous and previous != checker_name:
task.dep_changed = list(task.file_dep)
# remove all saved values otherwise they might be re-used by
# some optmization on MD5Checker.get_state()
# some optimization on MD5Checker.get_state()
self.remove(task.name)
if result.set_reason('checker_changed', (previous, checker_name)):
return result
Expand Down
4 changes: 2 additions & 2 deletions doit/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Handle exceptions generated from 'user' code"""
"""Handle exceptions generated from 'user' code"""

import sys
import traceback
Expand Down Expand Up @@ -43,7 +43,7 @@ class InvalidTask(Exception):


class CatchedException(object):
"""This used to save info from catched exceptions
"""This used to save info from caught exceptions
The traceback from the original exception is saved
"""
def __init__(self, msg, exception=None):
Expand Down
8 changes: 4 additions & 4 deletions doit/loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Loads dodo file (a python module) and convert them to 'tasks' """
"""Loads dodo file (a python module) and convert them to 'tasks' """

import os
import sys
Expand All @@ -21,7 +21,7 @@

def flat_generator(gen, gen_doc=''):
"""return only values from generators
if any generator yields another generator it is recursivelly called
if any generator yields another generator it is recursively called
"""
for item in gen:
if inspect.isgenerator(item):
Expand Down Expand Up @@ -216,7 +216,7 @@ def load_doit_config(dodo_module):


def _generate_task_from_return(func_name, task_dict, gen_doc):
"""generate a single task from a dict return'ed by a task generator"""
"""generate a single task from a dict returned by a task generator"""
if 'name' in task_dict:
raise InvalidTask("Task '%s'. Only subtasks use field name." %
func_name)
Expand All @@ -232,7 +232,7 @@ def _generate_task_from_return(func_name, task_dict, gen_doc):


def _generate_task_from_yield(tasks, func_name, task_dict, gen_doc):
"""generate a single task from a dict yield'ed by task generator
"""generate a single task from a dict yielded by task generator

@param tasks: dictionary with created tasks
@return None: the created task is added to 'tasks' dict
Expand Down
Loading