Refactor DCCsi to work better with O3DE changes (#4226)
* moving files in refactor/re-org Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * dev env refactor/re-org Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * moving/re-org so we can deprate the SDK nomiclature Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * moving/re-org so we can deprate the SDK nomiclature Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * Refactoring env so I can replace SDK with Tools folder Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * re-org and prune, from SKD to Tools Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * Removing old .bat files from SDK Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * updated how to retreive PYTHONHOME Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * Can't use/set PYTHONHOME with DCC Tools Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * small refactor Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * repaired a missed typo (causes error) Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * Added missing EntityId.h include to FocusModeInterface.h Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * refactor additional LY to O3DE tags Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * Some design scaffold file stubs Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * stubbing in scaffold file pattern Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * Removal of corrupted prefabs Signed-off-by: Benjamin Black <benblac@amazon.com> * refactored config_utils to maintain py2.7 support for maya 2020 Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * refactored config_utils to maintain py2.7 support for maya 2020 Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * pruning and cleanup Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * .env is for local dev overrides Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * .env is for local dev overrides Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * clean up init and logging patterns Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * Core refactoring, config.py functional standalone Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * cleaned up some bad logging, fixed up boostrap Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * fixed validation errors Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * fix logging issue, tiddy up Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * tiddy up maya for .bat bootstraping and launch Signed-off-by: Jonny Gallowy <gallowj@amazon.com> * name stub, fix validation Signed-off-by: Jonny Gallowy <gallowj@amazon.com> Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Co-authored-by: Benjamin Black <benblac@amazon.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# coding:utf-8
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
__copyright__ = "Copyright 2021, Amazon"
|
||||
# -------------------------------------------------------------------------
|
||||
import sys
|
||||
import logging as _logging
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
#pulling from azpy.constants causes cyclical imports :(
|
||||
FRMT_LOG_LONG = "[%(name)s][%(levelname)s] >> %(message)s (%(asctime)s; %(filename)s:%(lineno)d)"
|
||||
_DCCSI_GDEBUG = False
|
||||
_DCCSI_LOGLEVEL = int(20)
|
||||
if _DCCSI_GDEBUG:
|
||||
_DCCSI_LOGLEVEL = int(10)
|
||||
|
||||
_PACKAGENAME = 'azpy.core'
|
||||
_logging.basicConfig(format=FRMT_LOG_LONG, level=_DCCSI_LOGLEVEL)
|
||||
_LOGGER = _logging.getLogger(_PACKAGENAME)
|
||||
_LOGGER.debug('Initializing: {0}.'.format({_PACKAGENAME}))
|
||||
|
||||
__all__ = []
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from azpy.core.py3.utils import get_datadir
|
||||
elif sys.version_info >= (2, 6) and sys.version_info < (3, 6):
|
||||
_LOGGER.warning('Python vesion < 3 will be deprecated in the future')
|
||||
from azpy.core.py2.utils import get_datadir
|
||||
else:
|
||||
_LOGGER.warning('Python vesion < 2.6 not recommended')
|
||||
from azpy.core.py2.utils import get_datadir
|
||||
|
||||
__all__ = ['get_datadir'] # you should hope it works
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
@@ -0,0 +1,20 @@
|
||||
# coding:utf-8
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
__copyright__ = "Copyright 2021, Amazon"
|
||||
# -------------------------------------------------------------------------
|
||||
import logging as _logging
|
||||
# -------------------------------------------------------------------------
|
||||
_PACKAGENAME = 'azpy.core.py2'
|
||||
_LOGGER = _logging.getLogger(_PACKAGENAME)
|
||||
_LOGGER.debug('Initializing: {0}.'.format({_PACKAGENAME}))
|
||||
|
||||
__all__ = []
|
||||
# -------------------------------------------------------------------------
|
||||
@@ -0,0 +1,59 @@
|
||||
# coding:utf-8
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
# -- This line is 75 characters -------------------------------------------
|
||||
"""DCCsi.azpy.core.py2.utils
|
||||
This module contain versions of utils speciufic to py3 snyntax"""
|
||||
import sys
|
||||
import logging as _logging
|
||||
|
||||
try:
|
||||
import pathlib
|
||||
except:
|
||||
import pathlib2 as pathlib
|
||||
|
||||
__all__ = ['get_datadir']
|
||||
|
||||
_MODULENAME = 'azpy.core.py2.utils'
|
||||
_LOGGER = _logging.getLogger(_MODULENAME)
|
||||
_LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
def get_datadir():
|
||||
"""
|
||||
persistent application data.
|
||||
# linux: ~/.local/share
|
||||
# macOS: ~/Library/Application Support
|
||||
# windows: C:/Users/<USER>/AppData/Roaming
|
||||
"""
|
||||
|
||||
home = pathlib.Path.home()
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
datadir = pathlib.Path(home, "AppData/Roaming")
|
||||
return datadir
|
||||
elif sys.platform == "linux":
|
||||
datadir = pathlib.Path(home, ".local/share")
|
||||
return datadir
|
||||
elif sys.platform == "darwin":
|
||||
datadir = pathlib.Path(home, "Library/Application Support")
|
||||
return datadir
|
||||
else: # unknown
|
||||
return None
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Main Code Block, runs this script as main (testing)
|
||||
# -------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
"""module testing"""
|
||||
|
||||
user_data_dir = get_datadir()
|
||||
_LOGGER.info(user_data_dir.resolve())
|
||||
@@ -0,0 +1,20 @@
|
||||
# coding:utf-8
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
__copyright__ = "Copyright 2021, Amazon"
|
||||
# -------------------------------------------------------------------------
|
||||
import logging as _logging
|
||||
# -------------------------------------------------------------------------
|
||||
_PACKAGENAME = 'azpy.core.py3'
|
||||
_LOGGER = _logging.getLogger(_PACKAGENAME)
|
||||
_LOGGER.debug('Initializing: {0}.'.format({_PACKAGENAME}))
|
||||
|
||||
__all__ = []
|
||||
# -------------------------------------------------------------------------
|
||||
@@ -0,0 +1,52 @@
|
||||
# coding:utf-8
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
# -- This line is 75 characters -------------------------------------------
|
||||
"""DCCsi.azpy.core.py3.utils
|
||||
This module contain versions of utils speciufic to py3 snyntax"""
|
||||
import sys
|
||||
import pathlib
|
||||
import logging as _logging
|
||||
|
||||
__all__ = ['get_datadir']
|
||||
|
||||
_MODULENAME = 'azpy.core.py3.utils'
|
||||
_LOGGER = _logging.getLogger(_MODULENAME)
|
||||
_LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
def get_datadir() -> pathlib.Path:
|
||||
"""
|
||||
persistent application data.
|
||||
# linux: ~/.local/share
|
||||
# macOS: ~/Library/Application Support
|
||||
# windows: C:/Users/<USER>/AppData/Roaming
|
||||
"""
|
||||
|
||||
home = pathlib.Path.home()
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
return home / "AppData/Roaming"
|
||||
elif sys.platform == "linux":
|
||||
return home / ".local/share"
|
||||
elif sys.platform == "darwin":
|
||||
return home / "Library/Application Support"
|
||||
else: # unknown
|
||||
return None
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Main Code Block, runs this script as main (testing)
|
||||
# -------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
"""module testing"""
|
||||
|
||||
user_data_dir = get_datadir()
|
||||
_LOGGER.info(user_data_dir.resolve())
|
||||
Reference in New Issue
Block a user