An encapsulation of all the files which make up the contents of a
profile.
The files are stored in a ZIP file with metadata. In order to
add/extract files to the profile, they are first copied to/from a
temporary directory which is then zipped. Note, though, that the fact
that its a ZIP file and the fact that there is a temporary directory are
both implementation details and not exposed in the API.
Profile files are stored in /etc/desktop-profiles.
Each file or directory in the profile has metadata associated with it
- the "source" of the file/directory and a set of arbitrary key
value pairs which that source may interpret.
|
__init__(self,
name)
Create a ProfileStorage.
|
|
__del__(self)
|
|
__create_empty_metadata_doc(self)
|
|
__read_metadata(self)
|
|
__get_node_source(self,
node)
|
|
__get_node_attributes(self,
node)
|
|
__update_file_or_dir_node(self,
file_or_dir_node,
source,
attributes,
metadata)
|
|
__update_file_node(self,
path,
source,
attributes,
metadata=None)
|
|
__update_directory_node(self,
path,
source,
attributes,
metadata=None)
|
|
__unpack(self)
|
|
__foreach_all(self,
callback,
user_data)
|
|
copy(self,
name)
Create a new ProfileStorage object, copying the contents of this
profile to the new profile.
|
|
add(self,
path,
src_dir,
source,
attributes=None,
src_path=None)
Add a new - or update an existing - file or directory to the
profile.
|
|
__get_dir_node(self,
path,
metadata=None)
|
|
__get_file_node(self,
path,
metadata=None)
|
|
__get_node(self,
path,
metadata=None)
|
|
remove(self,
path)
Remove a file or directory from the profile.
|
|
__get_item_type(self,
path)
|
|
get_extract_src_path(self,
path)
Return the src path of a file or directory for extraction from the
profile.
|
|
extract(self,
path,
dst_dir,
overwrite=False)
Extract a file or directory from the profile.
|
|
list(self,
source=None)
List the current contents of the profile.
|
|
__foreach_node(self,
node,
callback,
user_data,
source)
|
|
foreach(self,
callback,
user_data=None,
source=None)
Iterate over the contents of the profile:
|
|
save(self)
Save the contents of the profile to
/etc/desktop-profiles/$(name).zip.
|
|
get_attributes(self,
path)
Return the attributes associated with a file or directory from the
profile.
|
|
get_source(self,
path)
Return the source associated with a file or directory from the
profile.
|