|
@@ -28,9 +28,10 @@ class CoreSection(UniqueSection):
|
|
|
|
|
|
Attributes:
|
|
Attributes:
|
|
root_folder (str): Path of the base folder for the taipy application. The default value is "./taipy/"
|
|
root_folder (str): Path of the base folder for the taipy application. The default value is "./taipy/"
|
|
- storage_folder (str): Folder name used to store Taipy data. The default value is ".data/". It is used in
|
|
|
|
- conjunction with the *root_folder* attribute. That means the storage path is <root_folder><storage_folder>
|
|
|
|
- (The default path is "./taipy/.data/").
|
|
|
|
|
|
+ storage_folder (str): Folder name used to store user data. The default value is "user_data/". The default
|
|
|
|
+ path is "user_data/".
|
|
|
|
+ taipy_storage_folder (str): Folder name used to store Taipy data. The default value is ".taipy/". The default
|
|
|
|
+ path is "./taipy/".
|
|
repository_type (str): Type of the repository to be used to store Taipy data. The default value is
|
|
repository_type (str): Type of the repository to be used to store Taipy data. The default value is
|
|
"filesystem".
|
|
"filesystem".
|
|
repository_properties (Dict[str, Union[str, int]]): A dictionary of additional properties to be used by the
|
|
repository_properties (Dict[str, Union[str, int]]): A dictionary of additional properties to be used by the
|
|
@@ -54,7 +55,10 @@ class CoreSection(UniqueSection):
|
|
_DEFAULT_ROOT_FOLDER = "./taipy/"
|
|
_DEFAULT_ROOT_FOLDER = "./taipy/"
|
|
|
|
|
|
_STORAGE_FOLDER_KEY = "storage_folder"
|
|
_STORAGE_FOLDER_KEY = "storage_folder"
|
|
- _DEFAULT_STORAGE_FOLDER = ".data/"
|
|
|
|
|
|
+ _DEFAULT_STORAGE_FOLDER = "user_data/"
|
|
|
|
+
|
|
|
|
+ _STORAGE_FOLDER_TP_KEY = "taipy_storage_folder"
|
|
|
|
+ _DEFAULT_STORAGE_FOLDER_TP = ".taipy/"
|
|
|
|
|
|
_REPOSITORY_TYPE_KEY = "repository_type"
|
|
_REPOSITORY_TYPE_KEY = "repository_type"
|
|
_DEFAULT_REPOSITORY_TYPE = "filesystem"
|
|
_DEFAULT_REPOSITORY_TYPE = "filesystem"
|
|
@@ -83,6 +87,7 @@ class CoreSection(UniqueSection):
|
|
self,
|
|
self,
|
|
root_folder: Optional[str] = None,
|
|
root_folder: Optional[str] = None,
|
|
storage_folder: Optional[str] = None,
|
|
storage_folder: Optional[str] = None,
|
|
|
|
+ taipy_storage_folder: Optional[str] = None,
|
|
repository_type: Optional[str] = None,
|
|
repository_type: Optional[str] = None,
|
|
repository_properties: Optional[Dict[str, Union[str, int]]] = None,
|
|
repository_properties: Optional[Dict[str, Union[str, int]]] = None,
|
|
read_entity_retry: Optional[int] = None,
|
|
read_entity_retry: Optional[int] = None,
|
|
@@ -94,6 +99,7 @@ class CoreSection(UniqueSection):
|
|
):
|
|
):
|
|
self._root_folder = root_folder
|
|
self._root_folder = root_folder
|
|
self._storage_folder = storage_folder
|
|
self._storage_folder = storage_folder
|
|
|
|
+ self._taipy_storage_folder = taipy_storage_folder
|
|
self._repository_type = repository_type
|
|
self._repository_type = repository_type
|
|
self._repository_properties = repository_properties or {}
|
|
self._repository_properties = repository_properties or {}
|
|
self._read_entity_retry = (
|
|
self._read_entity_retry = (
|
|
@@ -112,6 +118,7 @@ class CoreSection(UniqueSection):
|
|
return CoreSection(
|
|
return CoreSection(
|
|
self.root_folder,
|
|
self.root_folder,
|
|
self.storage_folder,
|
|
self.storage_folder,
|
|
|
|
+ self.taipy_storage_folder,
|
|
self.repository_type,
|
|
self.repository_type,
|
|
self.repository_properties,
|
|
self.repository_properties,
|
|
self.read_entity_retry,
|
|
self.read_entity_retry,
|
|
@@ -131,6 +138,15 @@ class CoreSection(UniqueSection):
|
|
def storage_folder(self, val):
|
|
def storage_folder(self, val):
|
|
self._storage_folder = val
|
|
self._storage_folder = val
|
|
|
|
|
|
|
|
+ @property
|
|
|
|
+ def taipy_storage_folder(self):
|
|
|
|
+ return _tpl._replace_templates(self._taipy_storage_folder)
|
|
|
|
+
|
|
|
|
+ @taipy_storage_folder.setter # type: ignore
|
|
|
|
+ @_ConfigBlocker._check()
|
|
|
|
+ def taipy_storage_folder(self, val):
|
|
|
|
+ self._taipy_storage_folder = val
|
|
|
|
+
|
|
@property
|
|
@property
|
|
def root_folder(self):
|
|
def root_folder(self):
|
|
return _tpl._replace_templates(self._root_folder)
|
|
return _tpl._replace_templates(self._root_folder)
|
|
@@ -203,6 +219,7 @@ class CoreSection(UniqueSection):
|
|
return CoreSection(
|
|
return CoreSection(
|
|
cls._DEFAULT_ROOT_FOLDER,
|
|
cls._DEFAULT_ROOT_FOLDER,
|
|
cls._DEFAULT_STORAGE_FOLDER,
|
|
cls._DEFAULT_STORAGE_FOLDER,
|
|
|
|
+ cls._DEFAULT_STORAGE_FOLDER_TP,
|
|
cls._DEFAULT_REPOSITORY_TYPE,
|
|
cls._DEFAULT_REPOSITORY_TYPE,
|
|
cls._DEFAULT_REPOSITORY_PROPERTIES,
|
|
cls._DEFAULT_REPOSITORY_PROPERTIES,
|
|
cls._DEFAULT_READ_ENTITY_RETRY,
|
|
cls._DEFAULT_READ_ENTITY_RETRY,
|
|
@@ -215,6 +232,7 @@ class CoreSection(UniqueSection):
|
|
def _clean(self):
|
|
def _clean(self):
|
|
self._root_folder = self._DEFAULT_ROOT_FOLDER
|
|
self._root_folder = self._DEFAULT_ROOT_FOLDER
|
|
self._storage_folder = self._DEFAULT_STORAGE_FOLDER
|
|
self._storage_folder = self._DEFAULT_STORAGE_FOLDER
|
|
|
|
+ self._taipy_storage_folder = self._DEFAULT_STORAGE_FOLDER
|
|
self._repository_type = self._DEFAULT_REPOSITORY_TYPE
|
|
self._repository_type = self._DEFAULT_REPOSITORY_TYPE
|
|
self._repository_properties = self._DEFAULT_REPOSITORY_PROPERTIES.copy()
|
|
self._repository_properties = self._DEFAULT_REPOSITORY_PROPERTIES.copy()
|
|
self._read_entity_retry = self._DEFAULT_READ_ENTITY_RETRY
|
|
self._read_entity_retry = self._DEFAULT_READ_ENTITY_RETRY
|
|
@@ -230,6 +248,8 @@ class CoreSection(UniqueSection):
|
|
as_dict[self._ROOT_FOLDER_KEY] = self._root_folder
|
|
as_dict[self._ROOT_FOLDER_KEY] = self._root_folder
|
|
if self._storage_folder:
|
|
if self._storage_folder:
|
|
as_dict[self._STORAGE_FOLDER_KEY] = self._storage_folder
|
|
as_dict[self._STORAGE_FOLDER_KEY] = self._storage_folder
|
|
|
|
+ if self._taipy_storage_folder:
|
|
|
|
+ as_dict[self._STORAGE_FOLDER_TP_KEY] = self._taipy_storage_folder
|
|
if self._repository_type:
|
|
if self._repository_type:
|
|
as_dict[self._REPOSITORY_TYPE_KEY] = self._repository_type
|
|
as_dict[self._REPOSITORY_TYPE_KEY] = self._repository_type
|
|
if self._repository_properties:
|
|
if self._repository_properties:
|
|
@@ -251,6 +271,7 @@ class CoreSection(UniqueSection):
|
|
def _from_dict(cls, as_dict: Dict[str, Any], id=None, config: Optional[_Config] = None):
|
|
def _from_dict(cls, as_dict: Dict[str, Any], id=None, config: Optional[_Config] = None):
|
|
root_folder = as_dict.pop(cls._ROOT_FOLDER_KEY, None)
|
|
root_folder = as_dict.pop(cls._ROOT_FOLDER_KEY, None)
|
|
storage_folder = as_dict.pop(cls._STORAGE_FOLDER_KEY, None)
|
|
storage_folder = as_dict.pop(cls._STORAGE_FOLDER_KEY, None)
|
|
|
|
+ taipy_storage_folder = as_dict.pop(cls._STORAGE_FOLDER_TP_KEY, None)
|
|
repository_type = as_dict.pop(cls._REPOSITORY_TYPE_KEY, None)
|
|
repository_type = as_dict.pop(cls._REPOSITORY_TYPE_KEY, None)
|
|
repository_properties = as_dict.pop(cls._REPOSITORY_PROPERTIES_KEY, None)
|
|
repository_properties = as_dict.pop(cls._REPOSITORY_PROPERTIES_KEY, None)
|
|
read_entity_retry = as_dict.pop(cls._READ_ENTITY_RETRY_KEY, None)
|
|
read_entity_retry = as_dict.pop(cls._READ_ENTITY_RETRY_KEY, None)
|
|
@@ -261,6 +282,7 @@ class CoreSection(UniqueSection):
|
|
return CoreSection(
|
|
return CoreSection(
|
|
root_folder,
|
|
root_folder,
|
|
storage_folder,
|
|
storage_folder,
|
|
|
|
+ taipy_storage_folder,
|
|
repository_type,
|
|
repository_type,
|
|
repository_properties,
|
|
repository_properties,
|
|
read_entity_retry,
|
|
read_entity_retry,
|
|
@@ -274,6 +296,7 @@ class CoreSection(UniqueSection):
|
|
def _update(self, as_dict: Dict[str, Any], default_section=None):
|
|
def _update(self, as_dict: Dict[str, Any], default_section=None):
|
|
self._root_folder = as_dict.pop(self._ROOT_FOLDER_KEY, self._root_folder)
|
|
self._root_folder = as_dict.pop(self._ROOT_FOLDER_KEY, self._root_folder)
|
|
self._storage_folder = as_dict.pop(self._STORAGE_FOLDER_KEY, self._storage_folder)
|
|
self._storage_folder = as_dict.pop(self._STORAGE_FOLDER_KEY, self._storage_folder)
|
|
|
|
+ self._taipy_storage_folder = as_dict.pop(self._STORAGE_FOLDER_TP_KEY, self._taipy_storage_folder)
|
|
self._repository_type = as_dict.pop(self._REPOSITORY_TYPE_KEY, self._repository_type)
|
|
self._repository_type = as_dict.pop(self._REPOSITORY_TYPE_KEY, self._repository_type)
|
|
self._repository_properties.update(as_dict.pop(self._REPOSITORY_PROPERTIES_KEY, self._repository_properties))
|
|
self._repository_properties.update(as_dict.pop(self._REPOSITORY_PROPERTIES_KEY, self._repository_properties))
|
|
self._read_entity_retry = as_dict.pop(self._READ_ENTITY_RETRY_KEY, self._read_entity_retry)
|
|
self._read_entity_retry = as_dict.pop(self._READ_ENTITY_RETRY_KEY, self._read_entity_retry)
|
|
@@ -324,9 +347,12 @@ class CoreSection(UniqueSection):
|
|
Parameters:
|
|
Parameters:
|
|
root_folder (Optional[str]): Path of the base folder for the taipy application.
|
|
root_folder (Optional[str]): Path of the base folder for the taipy application.
|
|
The default value is "./taipy/"
|
|
The default value is "./taipy/"
|
|
- storage_folder (Optional[str]): Folder name used to store Taipy data. The default value is ".data/".
|
|
|
|
- It is used in conjunction with the `root_folder` field. That means the storage path is
|
|
|
|
- <root_folder><storage_folder> (The default path is "./taipy/.data/").
|
|
|
|
|
|
+ storage_folder (str): Folder name used to store user data. The default value is "user_data/". It is used in
|
|
|
|
+ conjunction with the *root_folder* attribute. That means the storage path is
|
|
|
|
+ <root_folder><storage_folder> (The default path is "./taipy/user_data/").
|
|
|
|
+ taipy_storage_folder (str): Folder name used to store Taipy data. The default value is ".taipy/". It is
|
|
|
|
+ used in conjunction with the *root_folder* attribute. That means the storage path is
|
|
|
|
+ <root_folder><storage_folder> (The default path is "./taipy/.taipy/").
|
|
repository_type (Optional[str]): The type of the repository to be used to store Taipy data.
|
|
repository_type (Optional[str]): The type of the repository to be used to store Taipy data.
|
|
The default value is "filesystem".
|
|
The default value is "filesystem".
|
|
repository_properties (Optional[Dict[str, Union[str, int]]]): A dictionary of additional properties
|
|
repository_properties (Optional[Dict[str, Union[str, int]]]): A dictionary of additional properties
|