Robot Framework
robot.utils.misc Namespace Reference

Classes

class  classproperty
 Property that works with classes in addition to instances. More...
 

Functions

def _is_camel_case_boundary (prev, char, next)
 
def _split_camel_case (string)
 
def isatty (stream)
 
def parse_re_flags (flags=None)
 
def plural_or_not (item)
 
def printable_name (string, code_style=False)
 Generates and returns printable name from the given string. More...
 
def seq2str (sequence, quote="'", sep=', ', lastsep=' and ')
 Returns sequence in format ‘'item 1’, 'item 2' and 'item 3'`. More...
 
def seq2str2 (sequence)
 Returns sequence in format [ item 1 | item 2 | ... More...
 
def test_or_task (str text, bool rpa)
 Replace 'test' with 'task' in the given text depending on rpa. More...
 

Function Documentation

◆ _is_camel_case_boundary()

def robot.utils.misc._is_camel_case_boundary (   prev,
  char,
  next 
)
private

Definition at line 65 of file misc.py.

◆ _split_camel_case()

def robot.utils.misc._split_camel_case (   string)
private

Definition at line 50 of file misc.py.

◆ isatty()

def robot.utils.misc.isatty (   stream)

Definition at line 116 of file misc.py.

◆ parse_re_flags()

def robot.utils.misc.parse_re_flags (   flags = None)

Definition at line 128 of file misc.py.

◆ plural_or_not()

def robot.utils.misc.plural_or_not (   item)

Definition at line 73 of file misc.py.

◆ printable_name()

def robot.utils.misc.printable_name (   string,
  code_style = False 
)

Generates and returns printable name from the given string.

Examples:
'simple'           -> 'Simple'
'name with spaces' -> 'Name With Spaces'
'more   spaces'    -> 'More Spaces'
'Cases AND spaces' -> 'Cases AND Spaces'
''                 -> ''

If 'code_style' is True:

'mixedCAPSCamel'   -> 'Mixed CAPS Camel'
'camelCaseName'    -> 'Camel Case Name'
'under_score_name' -> 'Under Score Name'
'under_and space'  -> 'Under And Space'
'miXed_CAPS_nAMe'  -> 'MiXed CAPS NAMe'
''                 -> ''

Definition at line 40 of file misc.py.

◆ seq2str()

def robot.utils.misc.seq2str (   sequence,
  quote = "'",
  sep = ', ',
  lastsep = ' and ' 
)

Returns sequence in format ‘'item 1’, 'item 2' and 'item 3'`.

Definition at line 79 of file misc.py.

◆ seq2str2()

def robot.utils.misc.seq2str2 (   sequence)

Returns sequence in format [ item 1 | item 2 | ...

].

Definition at line 90 of file misc.py.

◆ test_or_task()

def robot.utils.misc.test_or_task ( str  text,
bool  rpa 
)

Replace 'test' with 'task' in the given text depending on rpa.

 If given text is `test`, `test` or `task` is returned directly. Otherwise,
 pattern `{test}` is searched from the text and occurrences replaced with
 `test` or `task`.

 In both cases matching the word `test` is case-insensitive and the returned
 `test` or `task` has exactly same case as the original.

Definition at line 105 of file misc.py.