__init__.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # coding:utf-8
  2. #!/usr/bin/python
  3. #
  4. # Copyright (c) Contributors to the Open 3D Engine Project.
  5. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  6. #
  7. # SPDX-License-Identifier: Apache-2.0 OR MIT
  8. #
  9. #
  10. # -------------------------------------------------------------------------
  11. """! @brief
  12. <DCCsi>/azpy/__init__.py
  13. This is the shared pure-python api.
  14. """
  15. # -------------------------------------------------------------------------
  16. # standard imports
  17. import sys
  18. import os
  19. import site
  20. from pathlib import Path
  21. import logging as _logging
  22. # -------------------------------------------------------------------------
  23. # -------------------------------------------------------------------------
  24. # global scope
  25. from DccScriptingInterface import _PACKAGENAME, STR_CROSSBAR
  26. _PACKAGENAME = f'{_PACKAGENAME}.azpy'
  27. _LOGGER = _logging.getLogger(_PACKAGENAME)
  28. _LOGGER.debug('Initializing: {0}.'.format({_PACKAGENAME}))
  29. _MODULE_PATH = Path(__file__) # thos module should not be used as an entry
  30. __all__ = ['core',
  31. 'dcc',
  32. 'dev',
  33. 'o3de',
  34. 'shared',
  35. 'test',
  36. 'config_class',
  37. 'config_utils',
  38. 'constants',
  39. 'env_bool',
  40. 'general_utils',
  41. 'return_stub',
  42. 'logger']
  43. # future deprection of these modules
  44. # env_base and synthetic_env were precursors to using dynaconf
  45. from DccScriptingInterface import PATH_DCCSIG
  46. from DccScriptingInterface.globals import *
  47. PATH_DCCSI_AZPY = Path(_MODULE_PATH.parent)
  48. # debug breadcrumbs to check this module and used paths
  49. _LOGGER.debug(f'This MODULE_PATH: {_MODULE_PATH}')
  50. _LOGGER.debug(f'Default {ENVAR_PATH_DCCSIG}: {PATH_DCCSIG}')
  51. _LOGGER.debug(f'Default {ENVAR_O3DE_DEV}: {O3DE_DEV}')
  52. _LOGGER.debug(STR_CROSSBAR)
  53. # -------------------------------------------------------------------------
  54. ##########################################################################
  55. # Main Code Block, runs this script as main (testing)
  56. # -------------------------------------------------------------------------
  57. if __name__ == '__main__':
  58. """Run in debug perform local tests from IDE or CLI"""
  59. # This cli is no longer needed, it pre-existed config.py
  60. # use config.py cli as the entrypoint