Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

BrickService

Functions
find_brick_folder @classmethod

Find the folder of the brick by searching in the user bricks folder and the system bricks folder

brick_name : str
Return type : str
folder_is_brick @classmethod

return true if the provided folder is a brick. If the folder contains a settings.json and a src folder it is a brick

path : str
Return type : bool
get_all_brick_models @classmethod
Return type : list
get_brick_extension_dir @classmethod

Get the directory for a specific extension of a specific brick. You can store data of the brick in this folder. This folder is backup during backup process.

Warnings: The docker service creates a directory in the extension folder with the unique_name of the compose service. So don't create a folder with the same name.

brick_name : str
The name of the brick
extension_name : str
The name of the extension
Return type : str
get_brick_extensions_base_dir @classmethod

Get the extensions directory for a specific brick. You can store data of the brick in this folder. This folder is backup during backup process.

brick_name : str
The name of the brick
Return type : str
get_brick_model @classmethod
name : str
Return type : BrickModel
get_brick_name_from_path @classmethod

Get the brick name from a folder path

path : str
path to a file or folder inside a brick
Return type : str | None
get_brick_src_folder @classmethod

Get the folder of the brick source code

brick_name : str
Return type : str
get_brick_version @classmethod
name : str
Return type : str
get_parent_brick_folder @classmethod

Get the parent brick folder of a file or folder path

path : str
path to a file or folder
Return type : str | None
import_all_bricks_in_python @classmethod
import_brick_in_python @classmethod

Method to load a brick from path in python.

brick_name : str
_description_
brick_path : str
_description_
init @classmethod

Clear the BrickModel table and log all the messages that were waiting on start

list_brick_directories @classmethod

List all brick directories from both user and system brick folders.

Returns a list of BrickDirectoryDTO containing brick name and path. Only returns folders that are valid bricks (contain settings.json and src folder).

distinct : bool - False
If True, returns only one entry per brick name. User folder bricks take priority over system folder bricks.
Return type : list
log_brick_critical @classmethod
obj : Any
message : str
log_brick_error @classmethod
obj : Any
message : str
log_brick_info @classmethod
obj : Any
message : str
log_brick_message @classmethod
brick_name : str
message : str
status : Literal
log_brick_message_from_obj @classmethod

Log a message for the brick of the object. The message is save in DB so it can be viewed later

obj : Any
obj that caused the message. The brick information will be retrieve form the obj type
message : str
[description]
status : Literal
[description]
log_brick_warning @classmethod
obj : Any
message : str
read_brick_settings @classmethod

Read and parse the settings.json file from a brick folder path.

brick_path : str
Path to the brick folder
Return type : gws_core.brick.brick_settings.BrickSettings | None
rename_brick @classmethod

Rename brick objects and delete brick from settings /!\ This method is not safe and should be used with caution

old_brick_name : str
new_brick_name : str
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.