|
|
|
@ -6,7 +6,10 @@ from cms import disk, cloud
|
|
|
|
|
from jinja2 import Environment, BaseLoader, FileSystemLoader
|
|
|
|
|
import importlib
|
|
|
|
|
import importlib.util
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
There are four classes at play here:
|
|
|
|
|
[ Initializer ] <|-- [ Module ] <|-- [ MicroService ] <--<>[ CMS ]
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
class Initializer :
|
|
|
|
|
"""
|
|
|
|
@ -25,19 +28,12 @@ class Initializer :
|
|
|
|
|
# print ([self._ISCLOUD,self._config['system'].keys()])
|
|
|
|
|
self._ISCLOUD = False
|
|
|
|
|
self._caller = None if 'caller' not in _args else _args['caller']
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# actual initialization of the CMS components
|
|
|
|
|
# self._iconfig(**_args)
|
|
|
|
|
# self._uconfig(**_args)
|
|
|
|
|
# self._isource()
|
|
|
|
|
# self._imenu()
|
|
|
|
|
# self._iplugins()
|
|
|
|
|
|
|
|
|
|
self._args = _args
|
|
|
|
|
self.reload()
|
|
|
|
|
|
|
|
|
|
self.reload() #-- this is an initial load of various components
|
|
|
|
|
|
|
|
|
|
def reload(self):
|
|
|
|
|
|
|
|
|
|
self._iconfig(**self._args)
|
|
|
|
|
self._uconfig(**self._args)
|
|
|
|
|
self._isource()
|
|
|
|
@ -292,9 +288,9 @@ class Initializer :
|
|
|
|
|
|
|
|
|
|
# self.set('layout.root',os.sep.join([_path,_oroot]))
|
|
|
|
|
pass
|
|
|
|
|
class Accessor (Initializer):
|
|
|
|
|
class Module (Initializer):
|
|
|
|
|
"""
|
|
|
|
|
This is a basic structure for an application working in either portal or app mode
|
|
|
|
|
This is a basic structure for an application working in either portal or app mode,
|
|
|
|
|
"""
|
|
|
|
|
def __init__(self,**_args):
|
|
|
|
|
super().__init__(**_args)
|
|
|
|
@ -362,9 +358,9 @@ class Accessor (Initializer):
|
|
|
|
|
#
|
|
|
|
|
return _found
|
|
|
|
|
#
|
|
|
|
|
class MicroService (Accessor):
|
|
|
|
|
class MicroService (Module):
|
|
|
|
|
"""
|
|
|
|
|
This is a CMS MicroService class that is capable of initializing a site and exposing accessor functions
|
|
|
|
|
This is a CMS MicroService class that is capable of initializing a site and exposing Module functions
|
|
|
|
|
"""
|
|
|
|
|
def __init__(self,**_args):
|
|
|
|
|
super().__init__(**_args)
|
|
|
|
@ -389,6 +385,9 @@ class MicroService (Accessor):
|
|
|
|
|
|
|
|
|
|
return _handler.read(uri=_uri,config=self._config)
|
|
|
|
|
class CMS:
|
|
|
|
|
"""
|
|
|
|
|
This class aggregates microservices and allows the application of a given service (site/app)
|
|
|
|
|
"""
|
|
|
|
|
def __init__(self,**_args) :
|
|
|
|
|
|
|
|
|
|
# _app = Getter (path = path)
|
|
|
|
|