Files
o3de/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/noodely/test_foo.py
T
2021-06-23 10:55:22 -07:00

58 lines
1.8 KiB
Python

"""
Copyright (c) Contributors to the Open 3D Engine Project
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# test_foo.py
# just a dumb test object
# -------------------------------------------------------------------------
__author__ = 'HogJonny'
# -------------------------------------------------------------------------
from synth import synthesize
class Foo(object):
"""
This is a Class, it creates a Foo object... which does nothing really
"""
__property_tag = 'fooProperty'
# ------------------------------------------------------------------
def __init__(self, name='Foo', value='defaultValue', *args, **kwargs):
'''Class __init__'''
synthesize(self, 'name', name)
synthesize(self, Foo.__property_tag, value)
synthesize(self, 'test', 'testValue')
self.testDump = object.__getattribute__(self, 'test')
# This calls a class method
self.methodA()
# ------------------------------------------------------------------
def methodA(self):
'''Class synthesized property methods self-tests'''
"""test getters"""
print ('{0}.fooProperty is: {1}'
''.format(self.getName(), self.getFooProperty()))
"""test property retreival"""
print ('{0}.testDump is: {1}'
''.format(self.name, self.testDump))
# ----------------------------------------------------------------------
###########################################################################
# Main Code Block, will run the tool
# -------------------------------------------------------------------------
if __name__ == '__main__':
# create an object from Foo Class
myFoo = Foo()