OpenShot Video Editor  2.0.0
Public Member Functions | Public Attributes | List of all members
json_data.JsonDataStore Class Reference

This class which allows getting/setting of key/value settings, and loading and saving to json files. More...

Public Member Functions

def __init__ (self)
 
def get (self, key)
 Get copied value of a given key in data store. More...
 
def merge_settings (self, default, user)
 Merge settings files, removing invalid settings based on default settings This is only called by some sub-classes that use string keys. More...
 
def read_from_file (self, file_path)
 Load JSON settings from a file. More...
 
def set (self, key, value)
 Store value in key. More...
 
def write_to_file (self, file_path, data)
 Save JSON settings to a file. More...
 

Public Attributes

 data_type
 

Detailed Description

This class which allows getting/setting of key/value settings, and loading and saving to json files.

Internal storage of a dictionary. Uses json or simplejson packages to serialize and deserialize from json to dictionary. Keys are assumed to be strings, but subclasses which override get/set methods may use different key types. The write_to_file and read_from_file methods are key type agnostic.

Definition at line 46 of file json_data.py.

Constructor & Destructor Documentation

def json_data.JsonDataStore.__init__ (   self)

Definition at line 49 of file json_data.py.

Member Function Documentation

def json_data.JsonDataStore.get (   self,
  key 
)

Get copied value of a given key in data store.

Definition at line 55 of file json_data.py.

def json_data.JsonDataStore.merge_settings (   self,
  default,
  user 
)

Merge settings files, removing invalid settings based on default settings This is only called by some sub-classes that use string keys.

Definition at line 97 of file json_data.py.

def json_data.JsonDataStore.read_from_file (   self,
  file_path 
)

Load JSON settings from a file.

Definition at line 129 of file json_data.py.

def json_data.JsonDataStore.set (   self,
  key,
  value 
)

Store value in key.

Definition at line 75 of file json_data.py.

def json_data.JsonDataStore.write_to_file (   self,
  file_path,
  data 
)

Save JSON settings to a file.

Definition at line 147 of file json_data.py.

Member Data Documentation

json_data.JsonDataStore.data_type

Definition at line 51 of file json_data.py.


The documentation for this class was generated from the following file: