tbottest.initconfig

helper functions

tbottest.initconfig.init_get_config(cfgp: RawConfigParser, name: str, default: str) str[source]

returns value of key name from configparser.

Searches first for a “TC_BOARDNAME” section and if it there is not the key, search in section “TC”. If not found, return default value. If default value is “None” return None

Parameters:
  • cfgp – current config parser

  • name – name of key

  • default – default value if key is not found

tbottest.initconfig.generic_get_boardname()[source]

return the boards name in your lab setup

setup the boardname through tbot.flag selectableboardname

You can overwrite this by defining your own board_set_boardname() in boardspecific.py if you need another approach.

tbottest.initconfig.copy_file(filename, newfile)[source]

copy file filename to newfile

Parameters:
  • filename – full path and name of source file

  • newfile – full path and name of target file

tbottest.initconfig.replace_in_file(filename, string, newv)[source]

replace string in filename with string newv

Parameters:
  • filename – full path and name of source file

  • string – searchstring

  • newv – new value

tbottest.initconfig.find_in_file_and_append(filename, substring, append)[source]

append in file filename to the string substring the string append

Parameters:
  • filename – full path and name of source file

  • substring – string to which string append gets appended

  • append – appended string

tbottest.initconfig.find_in_file_and_delete(filename, substring)[source]

delete line in file filename when substring is found

Parameters:
  • filename – full path and name of source file

  • substring – substring which get searched

classes

class tbottest.initconfig.IniTBotConfig[source]

Bases: object

reads common tbot config

see: boardspecfic runtime adaptions

  • IniConfig - Init generic setup from BOARDNAME.ini.

class tbottest.initconfig.IniConfig[source]

Bases: object

reads board config

see: boardspecfic runtime adaptions

get_config(name: str, default: str)[source]

returns value of key name from configparser.

use internal function init_get_config

Parameters:
  • name – name of key

  • default – default value if key is not found

get_config_int(name: str, default: str)[source]

returns int value of key name from configparser.

use internal function init_get_config_int

Parameters:
  • name – name of key

  • default – default value if key is not found

get_default_config(name: str, default: str)[source]

return value of key from “default” section with name “name”

Parameters:
  • name – name of key

  • default – default value if key is not found