tree: 67bf163ccc6e48ee54e8e6dd24dbefd8b01a99a6 [path history] [tgz]
  1. README.md
  2. __init__.py
  3. arg_utils.py
  4. arg_utils_unittest.py
  5. argparse_utils.py
  6. argparse_utils_unittest.py
  7. config_utils.json
  8. config_utils.py
  9. config_utils.schema.json
  10. config_utils_unittest.py
  11. cros_board_utils.py
  12. cros_board_utils_unittest.py
  13. debug_utils.py
  14. debug_utils_unittest.py
  15. file_utils.py
  16. file_utils_unittest.py
  17. fmap.py
  18. gcs_utils.py
  19. gpio_utils.py
  20. json_utils.py
  21. json_utils_unittest.py
  22. jsonrpc_utils.py
  23. jsonrpc_utils_unittest.py
  24. log_utils.py
  25. log_utils_unittest.py
  26. net_utils.py
  27. net_utils_unittest.py
  28. platform_utils.py
  29. process_utils.py
  30. process_utils_unittest.py
  31. pygpt.py
  32. pygpt_unittest.py
  33. schema.py
  34. schema_unittest.py
  35. service_utils.py
  36. service_utils_unittest.py
  37. shelve_utils.py
  38. shelve_utils_unittest.py
  39. ssh_utils.py
  40. string_utils.py
  41. string_utils_unittest.py
  42. sync_utils.py
  43. sync_utils_unittest.py
  44. sys_interface.py
  45. sys_utils.py
  46. sys_utils_unittest.py
  47. testdata/
  48. thread_utils.py
  49. thread_utils_unittest.py
  50. time_utils.py
  51. time_utils_unittest.py
  52. type_utils.py
  53. type_utils_unittest.py
  54. watchdog_utils.py
  55. watchdog_utils_manualtest.py
  56. webservice_utils.py
  57. webservice_utils_unittest.py
  58. yaml_utils.py
  59. yaml_utils_unittest.py
py/utils/README.md

Chrome OS Factory Software Utilities

This directory contains utils that are designed to be portable for use both inside and outside of cros.factory code.

For factory code, utils should be imported under the usual namespace:

import factory_common
from cros.factory.utils import file_utils

For non-factory code located in this repository, suggested use is to create a symlink of the entire utils directory, or symlink individual files.

# cd my_project
# mkdir utils
# touch utils/__init__.py  # needed to mark utils as package
# ln -s ../path/to/utils/file_utils.py file_utils.py
from utils import file_utils

However, importing any utils module without being contained in a package namespace will fail:

# cd py/utils
import file_utils  # WILL FAIL
from file_utils import TouchFile  # WILL FAIL

# cd my_project
# ln -s ../path/to/utils/file_utils.py file_utils.py
import file_utils  # WILL FAIL