PMakeup cache¶
-
class
pmakeup.
IPMakeupCache
¶ -
abstract
get_name
() → str¶ human friendly name of the cache
-
abstract
get_variable_in_cache
(name: str) → Any¶ Obtain the variable value from the cache
- Parameters
name – the name of the varaible to obtain
- Returns
the variable obtained
-
abstract
has_variable_in_cache
(name: str) → bool¶ Check if the variable is present in the cache
- Parameters
name – the name of the variable to check
- Returns
true if the variable is present inthe cache, false otherwise
-
abstract
is_cache_present
() → bool¶ Check if the pmakeup cache is present
-
abstract
is_empty
() → bool¶ Check if there is at least one variable in cache
- Returns
true iff there is no variables in cache
-
abstract
reset
()¶ Completely empty the pmakeupfile. After the operation, the cache is present, but it is empty. It is required to persistently update the cache in this method
-
abstract
set_variable_in_cache
(name: str, value: Any, overwrites_is_exists: bool = True)¶ Set a variable in the cache.
- Parameters
name – name of the variable to add
value – value to store
overwrites_is_exists – if true, we will overwrite any previous variable in the cache
-
abstract
update_cache
()¶ Store the cache persistently
-
abstract
variable_names
() → Iterable[str]¶ Set of variable names available in the cache. They are only at top level
-
abstract
-
class
pmakeup.
JsonPMakeupCache
(file_path: str)¶ -
get_name
() → str¶ human friendly name of the cache
-
get_variable_in_cache
(name: str) → Any¶ Obtain the variable value from the cache
- Parameters
name – the name of the varaible to obtain
- Returns
the variable obtained
-
has_variable_in_cache
(name: str) → bool¶ Check if the variable is present in the cache
- Parameters
name – the name of the variable to check
- Returns
true if the variable is present inthe cache, false otherwise
-
is_cache_present
() → bool¶ Check if the pmakeup cache is present
-
is_empty
() → bool¶ Check if there is at least one variable in cache
- Returns
true iff there is no variables in cache
-
reset
()¶ Completely empty the pmakeupfile. After the operation, the cache is present, but it is empty. It is required to persistently update the cache in this method
-
set_variable_in_cache
(name: str, value: Any, overwrites_is_exists: bool = True)¶ Set a variable in the cache.
- Parameters
name – name of the variable to add
value – value to store
overwrites_is_exists – if true, we will overwrite any previous variable in the cache
-
update_cache
()¶ Store the cache persistently
-
variable_names
() → Iterable[str]¶ Set of variable names available in the cache. They are only at top level
-