Mbed LS
mbed_lstools.platform_database.PlatformDatabase Class Reference
Inheritance diagram for mbed_lstools.platform_database.PlatformDatabase:
object

Public Member Functions

 __init__ (self, database_files, primary_database=None)
 
 items (self, device_type='daplink')
 
 all_ids (self, device_type='daplink')
 
 get (self, index, default=None, device_type='daplink', verbose_data=False)
 
 add (self, id, platform_name, permanent=False, device_type='daplink')
 
 remove (self, id, permanent=False, device_type='daplink', verbose_data=False)
 

Static Public Attributes

 target_id_pattern = re.compile(r'^[a-fA-F0-9]{4}$')
 

Protected Member Functions

 _update_db (self)
 

Protected Attributes

 _prim_db
 
 _dbs
 
 _keys
 

Detailed Description

Represents a union of multiple platform database files.
Handles inter-process synchronization of database files.

Definition at line 396 of file platform_database.py.

Constructor & Destructor Documentation

◆ __init__()

mbed_lstools.platform_database.PlatformDatabase.__init__ (   self,
  database_files,
  primary_database = None 
)
Construct a PlatformDatabase object from a series of platform database files

Definition at line 403 of file platform_database.py.

Member Function Documentation

◆ _update_db()

mbed_lstools.platform_database.PlatformDatabase._update_db (   self)
protected

Definition at line 454 of file platform_database.py.

◆ add()

mbed_lstools.platform_database.PlatformDatabase.add (   self,
  id,
  platform_name,
  permanent = False,
  device_type = 'daplink' 
)
Add a platform to this database, optionally updating an origin
database

Definition at line 478 of file platform_database.py.

◆ all_ids()

mbed_lstools.platform_database.PlatformDatabase.all_ids (   self,
  device_type = 'daplink' 
)

Definition at line 440 of file platform_database.py.

◆ get()

mbed_lstools.platform_database.PlatformDatabase.get (   self,
  index,
  default = None,
  device_type = 'daplink',
  verbose_data = False 
)
Standard lookup function. Works exactly like a dict. If 'verbose_data'
is True, all data for the platform is returned as a dict.

Definition at line 443 of file platform_database.py.

◆ items()

mbed_lstools.platform_database.PlatformDatabase.items (   self,
  device_type = 'daplink' 
)

Definition at line 435 of file platform_database.py.

◆ remove()

mbed_lstools.platform_database.PlatformDatabase.remove (   self,
  id,
  permanent = False,
  device_type = 'daplink',
  verbose_data = False 
)
Remove a platform from this database, optionally updating an origin
database. If 'verbose_data' is True, all data for the platform is returned
as a dict.

Definition at line 498 of file platform_database.py.

Member Data Documentation

◆ _dbs

mbed_lstools.platform_database.PlatformDatabase._dbs
protected

Definition at line 408 of file platform_database.py.

◆ _keys

mbed_lstools.platform_database.PlatformDatabase._keys
protected

Definition at line 409 of file platform_database.py.

◆ _prim_db

mbed_lstools.platform_database.PlatformDatabase._prim_db
protected

Definition at line 405 of file platform_database.py.

◆ target_id_pattern

mbed_lstools.platform_database.PlatformDatabase.target_id_pattern = re.compile(r'^[a-fA-F0-9]{4}$')
static

Definition at line 401 of file platform_database.py.


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