@@ -205,25 +205,35 @@ def __init__(self):
205205 MBED_HTM_NAME = 'mbed.htm'
206206
207207 def mbedls_home_dir_init (self ):
208- """ Initialize data in home directory for locking features
208+ """! Initialize data in home directory for locking features
209+ @details Create '.mbed-ls' sub-directory in current user $HOME directory
209210 """
210211 if not os .path .isdir (os .path .join (self .HOME_DIR , self .MBEDLS_HOME_DIR )):
211212 os .mkdir (os .path .join (self .HOME_DIR , self .MBEDLS_HOME_DIR ))
212213
213214 def mbedls_get_mocks (self ):
214- # If there is a local mocking data use it and add / override manufacture_ids
215+ """! Load existing mocking configuration from current user $HOME directory
216+ @details If there is a local mocking data use it and add / override manufacture_ids
217+ """
215218 mock_ids = self .mock_read ()
216219 if mock_ids :
217220 self .debug (self .mbedls_get_mocks .__name__ , "mock data found, %d entries" % len (mock_ids ))
218221 for mid in mock_ids :
219222 self .manufacture_ids [mid ] = mock_ids [mid ]
220223
221224 def mbedls_get_global_lock (self ):
225+ """! Create lock (file lock) object used to guard operations on
226+ mock configuration file in current user $HOME directory
227+ @return Global lock object instance
228+ """
222229 file_path = os .path .join (self .HOME_DIR , self .MBEDLS_HOME_DIR , self .MBEDLS_GLOBAL_LOCK )
223230 lock = lockfile .LockFile (file_path )
224231 return lock
225232
226233 def list_manufacture_ids (self ):
234+ """! Creates list of all available mappings for target_id -> Platform
235+ @return String with table formatted output
236+ """
227237 from prettytable import PrettyTable
228238
229239 columns = ['target_id_prefix' , 'platform_name' ]
@@ -239,6 +249,8 @@ def list_manufacture_ids(self):
239249
240250 def mock_read (self ):
241251 """! Load mocking data from local file
252+ @details Uses file locking for operation on Mock
253+ configuration file in current user $HOME directory
242254 @return Curent mocking configuration (dictionary)
243255 """
244256
@@ -281,6 +293,9 @@ def read_mock_file(filename):
281293 def mock_write (self , mock_ids ):
282294 """! Write current mocking structure
283295 @param mock_ids JSON mock data to dump to file
296+ @details Uses file locking for operation on Mock
297+ configuration file in current user $HOME directory
298+ @return True if configuration operation was success, else False
284299 """
285300 def write_mock_file (filename , mock_ids ):
286301 try :
@@ -330,6 +345,8 @@ def retarget_read(self):
330345
331346 def retarget (self ):
332347 """! Enable retargeting
348+ @details Read data from local retarget configuration file
349+ @return Retarget data structure read from configuration file
333350 """
334351 self .retarget_data = self .retarget_read ()
335352 return self .retarget_data
0 commit comments