1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-05 18:30:50 +01:00
Go to file
Douglas Raillard 6939e5660e target: Cleanup and lazily initialize modules
Cleanup the module loading code and enable lazy initialization of modules:

* Target.modules is now a read-only property, that is a list of strings
  (always, not either strings or dict with mod name as key and params dict as
  value).
  Target._modules dict stores parameters for each module that was asked
  for.

* Target.__init__() now makes thorough validation of the modules list it
  is given:
    * Specifying the same module mulitple time is only allowed if they
      are specified with the same parameters. If a module is specified
      both with and without parameters, the parameters take precedence
      and the conflict is resolved.
    * Only one module of each "kind" can be present in the list.

* Module subclasses gained a class attribute "attr_name" that computes
  their "attribute name", i.e. the name under which they are expected to
  be lookedup on a Target instance.

* Modules are now automatically registered by simple virtue of
  inheriting from Module and defining a name, wherever the source
  resides. They do not have to be located in devlib.modules anymore.
  This allows 3rd party module providers to very easily add new ones.

* Modules are accessible as Target attribute as:
    * Their "kind" if they specified one
    * Their "name" (always)

    This allows the consumer to either rely on a generic API (via the
    "kind") or to expect a specific module (via the "name").

* Accessing a module on Target will lazily load it even if was not
  selected using Target(modules=...):
    * If the module parameters were specified in Target(modules=...) or
      via platform modules, they will be applied automatically.
    * Otherwise, no parameter is passed.
    * If no module can be found with that name, the list of
      Target.modules will be searched for a module matching the given
      kind. The first one to be found will be used.

* Modules specified in Target(modules=...) are still loaded eagerly when
  their stage is reached just like it used to. We could easily make
  those lazily loaded though if we wanted.

* Specifying Target(modules={'foo': None}) will make the "foo" module
  unloadable. This can be used to prevent lazy loading a specific
  module.
2024-04-24 10:04:09 -05:00
devlib target: Cleanup and lazily initialize modules 2024-04-24 10:04:09 -05:00
doc tools/docker: Add Docker image support for devlib 2024-04-01 14:02:38 -05:00
src instrument/daq: Use clock boottime for the time column of the energy measurements 2020-11-09 17:27:21 +00:00
tests test_target.py: Allow specifying connection timeout for Android targets 2024-04-01 14:02:38 -05:00
tools tools/docker: Add Docker image support for devlib 2024-04-01 14:02:38 -05:00
.gitignore Add build/ and dist/ to .gitingore 2017-04-26 17:19:55 +01:00
.readthedocs.yml docs: Add readthedocs config and requirements.txt 2021-10-28 11:03:08 +01:00
README.rst README: Update to include installation notes for paramiko 2020-04-20 12:03:42 +01:00
setup.py tests/test_target: Read target connection settings from a YAML file 2024-02-23 12:48:44 -08:00

devlib
======

``devlib`` exposes an interface for interacting with and collecting
measurements from a variety of devices (such as mobile phones, tablets and
development boards) running a Linux-based operating system.


Installation
------------

::

        sudo -H pip install devlib


Dependencies
------------

``devlib`` should install all dependencies automatically, however if you run
into issues please ensure you are using that latest version of pip.

On some systems there may additional steps required to install the dependency
``paramiko`` please consult the `module documentation <http://www.paramiko.org/installing.html>`_
for more information.

Usage
-----

Please refer  to the "Overview" section of the `documentation <http://devlib.readthedocs.io/en/latest/>`_.


License
-------

This package is distributed under `Apache v2.0 License <http://www.apache.org/licenses/LICENSE-2.0>`_. 


Feedback, Contrubutions and Support
-----------------------------------

- Please use the GitHub Issue Tracker associated with this repository for
  feedback.
- ARM licensees may contact ARM directly via their partner managers.
- We welcome code contributions via GitHub Pull requests. Please try to
  stick to the style in the rest of the code for your contributions.