Client Utilities

General Utilities

general_utils.find_path_to_pardir(pardir, base_path='/auto/srg-sce-swinfra-usr/emb/users/hhaim/work/depot/asr1k/emb/private/hhaim/bp_sim_git/trex-core/scripts/automation/trex_control_plane/doc')[source]

Finds the absolute path for some parent dir pardir, starting from base_path

The request is only valid if the stop initiator is the same client as the TRex run initiator.

Parameters
pardirstr

name of an upper-level directory to which we want to find an absolute path for

base_pathstr

a full (usually nested) path from which we want to find a parent folder.

default value : current working dir

Returns

string representation of the full path to

general_utils.id_count_gen()[source]

A generator for creating an increasing id for objects, starting from 0

Parameters

None

Returns

an id (unsigned int) with each next() request.

general_utils.random_id_gen(length=8)[source]

A generator for creating a random chars id of specific length

Parameters
lengthint

the desired length of the generated id

default: 8

Returns

a random id with each next() request.