You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

__init__.py 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. """
  2. mbed SDK
  3. Copyright (c) 2011-2013 ARM Limited
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. """
  14. import host_test_registry
  15. # This plugins provide 'flashing' methods to host test scripts
  16. import module_copy_mbed
  17. import module_copy_shell
  18. import module_copy_silabs
  19. #import module_copy_firefox
  20. #import module_copy_mps2
  21. # Plugins used to reset certain platform
  22. import module_reset_mbed
  23. import module_reset_silabs
  24. #import module_reset_mps2
  25. # Plugin registry instance
  26. HOST_TEST_PLUGIN_REGISTRY = host_test_registry.HostTestRegistry()
  27. # Static plugin registration
  28. # Some plugins are commented out if they are not stable or not commonly used
  29. HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_mbed.load_plugin())
  30. HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_shell.load_plugin())
  31. HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_mbed.load_plugin())
  32. #HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_firefox.load_plugin())
  33. # Extra platforms support
  34. #HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_mps2.load_plugin())
  35. #HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_mps2.load_plugin())
  36. HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_silabs.load_plugin())
  37. HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_silabs.load_plugin())
  38. # TODO: extend plugin loading to files with name module_*.py loaded ad-hoc
  39. ###############################################################################
  40. # Functional interface for host test plugin registry
  41. ###############################################################################
  42. def call_plugin(type, capability, *args, **kwargs):
  43. """ Interface to call plugin registry functional way
  44. """
  45. return HOST_TEST_PLUGIN_REGISTRY.call_plugin(type, capability, *args, **kwargs)
  46. def get_plugin_caps(type):
  47. """ Returns list of all capabilities for plugin family with the same type.
  48. If there are no capabilities empty list is returned
  49. """
  50. return HOST_TEST_PLUGIN_REGISTRY.get_plugin_caps(type)
  51. def print_plugin_info():
  52. """ Prints plugins' information in user friendly way
  53. """
  54. print HOST_TEST_PLUGIN_REGISTRY