diff --git a/LICENSE b/LICENSE index 3a4b40f..14b8fe7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ kas - setup tool for bitbake based projects -Copyright (c) Siemens AG, 2017 +Copyright (c) Siemens AG, 2017-2018 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/conf.py b/docs/conf.py index e801795..e373aad 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,7 +60,7 @@ master_doc = 'index' # General information about the project. project = 'kas' -copyright = 'Siemens AG, 2017' +copyright = 'Siemens AG, 2017-2018' author = 'Daniel Wagner, Jan Kiszka, Claudius Heine' # The version info for the project you're documenting, acts as replacement for diff --git a/kas/__init__.py b/kas/__init__.py index 4dbc3f1..2d8dd23 100644 --- a/kas/__init__.py +++ b/kas/__init__.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -28,4 +28,4 @@ from .__version__ import __file_version__, __compatible_file_version__ from .configschema import CONFIGSCHEMA __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' diff --git a/kas/__main__.py b/kas/__main__.py index 2e8fa47..d729ab5 100644 --- a/kas/__main__.py +++ b/kas/__main__.py @@ -2,7 +2,7 @@ # # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -28,6 +28,6 @@ from .kas import main __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' main() diff --git a/kas/__version__.py b/kas/__version__.py index 0a65bfd..68cef83 100644 --- a/kas/__version__.py +++ b/kas/__version__.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,7 +23,7 @@ This module contains the version of kas. """ __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' __version__ = '0.18.0' diff --git a/kas/build.py b/kas/build.py index 9b2a4be..57f6395 100644 --- a/kas/build.py +++ b/kas/build.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ from .libcmds import (Macro, Command, SetupDir, CleanupSSHAgent, SetupReposStep) __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' @kasplugin @@ -115,7 +115,7 @@ class Build: class BuildCommand(Command): """ - Implement the bitbake build step. + Implements the bitbake build step. """ def __init__(self, task): diff --git a/kas/config.py b/kas/config.py index 0ccd156..284f5d6 100644 --- a/kas/config.py +++ b/kas/config.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,7 @@ from .repos import Repo from .includehandler import IncludeHandler, IncludeException __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' class Config: @@ -83,8 +83,8 @@ class Config: def _get_repo_dict(self): """ Returns a dictionary containing the repositories with - their name (as it is defined in the config file) as key - and the `Repo` instances as value. + their names (as it is defined in the config file) as keys + and the `Repo` instances as values. """ repo_config_dict = self._config.get('repos', {}) repo_dict = {} @@ -113,7 +113,7 @@ class Config: def get_bitbake_task(self): """ - Return the bitbake task + Returns the bitbake task """ return os.environ.get('KAS_TASK', self._config.get('task', 'build')) @@ -156,7 +156,7 @@ class Config: def get_environment(self): """ Returns the configured environment variables from the configuration - file, with possible overwritten values from the environment. + file with possible overwritten values from the environment. """ env = self._config.get('env', {}) return {var: os.environ.get(var, env[var]) for var in env} diff --git a/kas/configschema.py b/kas/configschema.py index 69e7e81..bccfcb5 100644 --- a/kas/configschema.py +++ b/kas/configschema.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the 'Software'), to deal @@ -24,7 +24,7 @@ This module contains the schema of the configuration file. ''' __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' CONFIGSCHEMA = { 'type': 'object', diff --git a/kas/context.py b/kas/context.py index 89fa3ed..04b5f44 100644 --- a/kas/context.py +++ b/kas/context.py @@ -53,7 +53,7 @@ __context__ = None def create_global_context(): """ - Create global context as singleton. + Creates global context as singleton. """ # pylint: disable=global-statement global __context__ @@ -63,7 +63,7 @@ def create_global_context(): def get_context(): """ - Return singleton global context. + Returns singleton global context. """ return __context__ @@ -82,7 +82,7 @@ class Context: def setup_initial_environ(self): """ - Sets the environment variables for process that are + Sets the environment variables for processes that are started by kas. """ self.environ = {} @@ -110,7 +110,7 @@ class Context: @property def build_dir(self): """ - The path of the build directory + The path to the build directory """ return os.path.join(self.__kas_work_dir, 'build') diff --git a/kas/includehandler.py b/kas/includehandler.py index eadfc1b..faba8ab 100644 --- a/kas/includehandler.py +++ b/kas/includehandler.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -36,12 +36,12 @@ from . import __file_version__, __compatible_file_version__ from . import CONFIGSCHEMA __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' class LoadConfigException(Exception): """ - Class for exceptions that appear while loading the configuration file. + Class for exceptions that appear while loading a configuration file. """ def __init__(self, message, filename): super().__init__('{}: {}'.format(message, filename)) @@ -73,7 +73,7 @@ def load_config(filename): logging.error('Config file validation Error:\n%s', error) if validation_error: - raise LoadConfigException('Errors occured while validating the ' + raise LoadConfigException('Error(s) occured while validating the ' 'config file', filename) try: @@ -108,16 +108,17 @@ class IncludeHandler: contain a dictionary as the base type with and 'includes' key containing a list of includes. - The includes can be specified in two ways, as a string + The includes can be specified in two ways: as a string containing the relative path from the current file or as a - dictionary. The dictionary should have a 'file' key, containing + dictionary. The dictionary should have a 'file' key containing the relative path to the include file and optionally a 'repo' - key, containing the key of the repository. If the 'repo' key is - missing the value of the 'file' key is treated the same as if + key containing the key of the repository. If the 'repo' key is + missing the value of the 'file' key, it is treated the same as if just a string was defined, meaning the path is relative to the - current config file otherwise its relative to the repository path. + current config file. Otherwise it is interpreted relative to + the repository path. - The includes are read and merged depth first from top to buttom. + The includes are read and merged from the deepest level upwards. """ def __init__(self, top_files): @@ -126,7 +127,7 @@ class IncludeHandler: def get_config(self, repos=None): """ Parameters: - repos -- A dictionary that maps repo name to directory path + repos -- A dictionary that maps repo names to directory paths Returns: (config, repos) @@ -139,7 +140,7 @@ class IncludeHandler: def _internal_include_handler(filename): """ - Recursively load include files and find missing repos. + Recursively loads include files and finds missing repos. Includes are done in the following way: @@ -161,7 +162,7 @@ class IncludeHandler: 'include-repo2.yml', 'include-repo2.yml', 'topfile.yml'] On conflict the latter includes overwrite previous ones and the current file overwrites every include. (evaluation depth first - and from top to buttom) + and from top to bottom) """ # pylint: disable=too-many-arguments @@ -219,9 +220,9 @@ class IncludeHandler: """ Merges upd recursively into a copy of dest as OrderedDict - If recursive_merge=False, will use the classic dict.update, - or fall back on a manual merge (helpful for non-dict types - like FunctionWrapper) + If recursive_merge is False, it will use the classic dict.update, + otherwise it will fall back on a manual merge (helpful for non-dict + types like FunctionWrapper) """ if (not isinstance(dest, Mapping)) \ or (not isinstance(upd, Mapping)): diff --git a/kas/kas.py b/kas/kas.py index 7a35a41..41e18dd 100644 --- a/kas/kas.py +++ b/kas/kas.py @@ -2,7 +2,7 @@ # # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -53,7 +53,7 @@ from . import build from . import shell __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' def create_logger(): @@ -90,7 +90,7 @@ def interruption(): def _atexit_handler(): """ - Wait for completion of the event loop + Waits for completion of the event loop """ loop = asyncio.get_event_loop() pending = asyncio.Task.all_tasks() @@ -100,7 +100,7 @@ def _atexit_handler(): def kas_get_argparser(): """ - Creates a argparser for kas with all plugins. + Creates an argparser for kas with all plugins. """ parser = argparse.ArgumentParser(description='kas - setup tool for ' 'bitbake based project') @@ -126,7 +126,7 @@ def kas_get_argparser(): def kas(argv): """ - The main entry point of kas. + The actual main entry point of kas. """ create_logger() diff --git a/kas/libcmds.py b/kas/libcmds.py index 0a0e589..50963f1 100644 --- a/kas/libcmds.py +++ b/kas/libcmds.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. """ - This module contain common commands used by kas plugins. + This module contains common commands used by kas plugins. """ import tempfile @@ -33,12 +33,12 @@ from .libkas import (ssh_cleanup_agent, ssh_setup_agent, ssh_no_host_key_check, from .includehandler import IncludeException __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' class Macro: """ - Contains commands and provide method to run them. + Contains commands and provides method to run them. """ def __init__(self): self.commands = [] @@ -51,7 +51,8 @@ class Macro: def run(self, ctx, skip=None): """ - Runs command from the command list respective to the configuration. + Runs a command from the command list with respect to the + configuration. """ skip = skip or [] for command in self.commands: @@ -87,7 +88,7 @@ class Loop(Command): def add(self, command): """ - Appends commands to the loop. + Appends a command to the loop. """ self.commands.append(command) @@ -108,7 +109,7 @@ class Loop(Command): class SetupHome(Command): """ - Setups the home directory of kas. + Sets up the home directory of kas. """ def __init__(self): @@ -149,7 +150,7 @@ class SetupDir(Command): class SetupSSHAgent(Command): """ - Setup the ssh agent configuration. + Sets up the ssh agent configuration. """ def __str__(self): @@ -162,7 +163,7 @@ class SetupSSHAgent(Command): class CleanupSSHAgent(Command): """ - Remove all the identities and stop the ssh-agent instance. + Removes all the identities and stops the ssh-agent instance. """ def __str__(self): @@ -174,7 +175,7 @@ class CleanupSSHAgent(Command): class SetupEnviron(Command): """ - Setups the kas environment. + Sets up the kas environment. """ def __str__(self): @@ -246,7 +247,7 @@ class ReposApplyPatches(Command): class ReposCheckout(Command): """ - Ensures that the right revision of each repo is check out. + Ensures that the right revision of each repo is checked out. """ def __str__(self): @@ -259,7 +260,7 @@ class ReposCheckout(Command): class InitSetupRepos(Command): """ - Setup repos including the include logic + Prepares setting up repos including the include logic """ def __str__(self): @@ -316,7 +317,7 @@ class SetupReposStep(Command): class FinishSetupRepos(Command): """ - Command to finalize the repo setup loop + Finalizes the repo setup loop """ def __str__(self): diff --git a/kas/libkas.py b/kas/libkas.py index dbd995b..1b3826f 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,7 @@ from subprocess import Popen, PIPE from .context import get_context __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' class LogOutput: @@ -48,7 +48,7 @@ class LogOutput: def log_stdout(self, line): """ - This method is called when a line over stdout is received. + This method is called when a line is received over stdout. """ if self.live: logging.info(line.strip()) @@ -56,7 +56,7 @@ class LogOutput: def log_stderr(self, line): """ - This method is called when a line over stderr is received. + This method is called when a line is received over stderr. """ if self.live: logging.error(line.strip()) @@ -74,7 +74,7 @@ def _read_stream(stream, callback): try: line = line.decode('utf-8') except UnicodeDecodeError as err: - logging.warning('Could not decode line from stream, ignore it: %s', + logging.warning('Could not decode line from stream, ignoring: %s', err) if line: callback(line) @@ -201,7 +201,7 @@ def repos_apply_patches(repos): def get_build_environ(): """ - Create the build environment variables. + Creates the build environment variables. """ # pylint: disable=too-many-locals # nasty side effect function: running oe/isar-init-build-env also @@ -274,7 +274,7 @@ def get_build_environ(): def ssh_add_key(env, key): """ - Add ssh key to the ssh-agent + Adds an ssh key to the ssh-agent """ process = Popen(['ssh-add', '-'], stdin=PIPE, stdout=None, stderr=PIPE, env=env) @@ -285,7 +285,7 @@ def ssh_add_key(env, key): def ssh_cleanup_agent(): """ - Removes the identities and stop the ssh-agent instance + Removes the identities and stops the ssh-agent instance """ env = get_context().environ # remove the identities @@ -335,7 +335,7 @@ def ssh_no_host_key_check(): def kasplugin(plugin_class): """ - A decorator that registeres kas plugins + A decorator that registers kas plugins """ if not hasattr(kasplugin, 'plugins'): setattr(kasplugin, 'plugins', []) diff --git a/kas/repos.py b/kas/repos.py index 417280b..8eb0586 100644 --- a/kas/repos.py +++ b/kas/repos.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,7 @@ from .context import get_context from .libkas import run_cmd_async, run_cmd __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' class Repo: @@ -74,7 +74,7 @@ class Repo: @staticmethod def factory(name, repo_config, repo_fallback_path): """ - Return an instance Repo depending on params. + Returns a Repo instance depending on params. """ layers_dict = repo_config.get('layers', {}) layers = list(filter(lambda x, laydict=layers_dict: @@ -125,7 +125,7 @@ class Repo: @staticmethod def get_root_path(path, fallback=True): """ - Check if path is a version control repo and return its root path. + Checks if path is under version control and returns its root path. """ (ret, output) = run_cmd(['git', 'rev-parse', '--show-toplevel'], cwd=path, fail=False, liveupdate=False) @@ -148,7 +148,7 @@ class RepoImpl(Repo): @asyncio.coroutine def fetch_async(self): """ - Start asynchronous repository fetch. + Starts asynchronous repository fetch. """ if self.operations_disabled: return 0 @@ -203,7 +203,7 @@ class RepoImpl(Repo): cwd=self.path, fail=False) if output: - logging.warning('Repo %s is dirty. no checkout', self.name) + logging.warning('Repo %s is dirty - no checkout', self.name) return # Check if current HEAD is what in the config file is defined. @@ -211,8 +211,8 @@ class RepoImpl(Repo): cwd=self.path) if output.strip() == self.refspec: - logging.info('Repo %s has already checkout out correct ' - 'refspec. nothing to do', self.name) + logging.info('Repo %s has already been checked out with correct ' + 'refspec. Nothing to do.', self.name) return run_cmd(self.checkout_cmd(), cwd=self.path) @@ -220,7 +220,7 @@ class RepoImpl(Repo): @asyncio.coroutine def apply_patches_async(self): """ - Applies patches to repository asynchronously. + Applies patches to a repository asynchronously. """ if self.operations_disabled: return 0 @@ -272,7 +272,7 @@ class RepoImpl(Repo): class GitRepo(RepoImpl): """ - Provides the git implementations for a Repo. + Provides the git functionality for a Repo. """ # pylint: disable=no-self-use,missing-docstring @@ -308,7 +308,7 @@ class GitRepo(RepoImpl): class MercurialRepo(RepoImpl): """ - Provides the hg implementations for a Repo. + Provides the hg functionality for a Repo. """ # pylint: disable=no-self-use,missing-docstring,unused-argument diff --git a/kas/shell.py b/kas/shell.py index c1233a3..c7d0bff 100644 --- a/kas/shell.py +++ b/kas/shell.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ from .libcmds import (Macro, Command, SetupDir, SetupEnviron, SetupReposStep) __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' @kasplugin diff --git a/run-kas b/run-kas index 396a5ae..fe74062 100755 --- a/run-kas +++ b/run-kas @@ -2,7 +2,7 @@ # # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/setup.py b/setup.py index 3093152..7f101aa 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ from setuptools import setup, find_packages from kas import __version__ __license__ = 'MIT' -__copyright__ = 'Copyright (c) Siemens AG, 2017' +__copyright__ = 'Copyright (c) Siemens AG, 2017-2018' HERE = path.abspath(path.dirname(__file__)) with open(path.join(HERE, 'README.rst')) as f: diff --git a/tests/test_includehandler.py b/tests/test_includehandler.py index 030d2ee..f91fc77 100644 --- a/tests/test_includehandler.py +++ b/tests/test_includehandler.py @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2017 +# Copyright (c) Siemens AG, 2017-2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal