Robot Framework Integrated Development Environment (RIDE)
robotide.lib.robot.utils.misc Namespace Reference

Functions

def _is_camel_case_boundary (prev, char, next)
 
def _roundup (number, ndigits)
 
def _split_camel_case (string)
 
def plural_or_not (item)
 
def printable_name (string, code_style=False)
 Generates and returns printable name from the given string. More...
 
def roundup (number, ndigits=0, return_type=None)
 Rounds number to the given number of digits. 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...
 

Variables

 _roundup
 

Function Documentation

◆ _is_camel_case_boundary()

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

Definition at line 101 of file misc.py.

◆ _roundup()

def robotide.lib.robot.utils.misc._roundup (   number,
  ndigits 
)
private

Definition at line 50 of file misc.py.

◆ _split_camel_case()

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

Definition at line 86 of file misc.py.

◆ plural_or_not()

def robotide.lib.robot.utils.misc.plural_or_not (   item)

Definition at line 109 of file misc.py.

◆ printable_name()

def robotide.lib.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 76 of file misc.py.

◆ roundup()

def robotide.lib.robot.utils.misc.roundup (   number,
  ndigits = 0,
  return_type = None 
)

Rounds number to the given number of digits.

Numbers equally close to a certain precision are always rounded away from
zero. By default return value is float when ``ndigits`` is positive and
int otherwise, but that can be controlled with ``return_type``.

With the built-in ``round()`` rounding equally close numbers as well as
the return type depends on the Python version.

Definition at line 34 of file misc.py.

◆ seq2str()

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

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

Definition at line 115 of file misc.py.

◆ seq2str2()

def robotide.lib.robot.utils.misc.seq2str2 (   sequence)

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

].

Definition at line 126 of file misc.py.

Variable Documentation

◆ _roundup

robotide.lib.robot.utils.misc._roundup
private

Definition at line 48 of file misc.py.