NM.Range

Fields

None

Methods

class

from_str (str)

class

new (start, end)

cmp (b)

get_range ()

ref ()

to_str ()

unref ()

Details

class NM.Range
classmethod from_str(str)
Parameters:

str (str) – the string representation of a range

Raises:

GLib.Error

Returns:

the NM.Range or None

Return type:

NM.Range

Parses the string representation of the range to create a NM.Range instance.

New in version 1.42.

classmethod new(start, end)
Parameters:
  • start (int) – the first element of the range

  • end (int) – the last element of the range, must be greater than or equal to start.

Returns:

the new NM.Range object.

Return type:

NM.Range

Creates a new NM.Range object for the given range. Setting end equal to start creates a single-element range.

New in version 1.42.

cmp(b)
Parameters:

b (NM.Range) – another NM.Range

Returns:

zero if the two instances are equivalent or a non-zero integer otherwise. This defines a total ordering over the ranges.

Return type:

int

Compare two ranges.

New in version 1.42.

get_range()
Returns:

True if the range contains more than one element, False otherwise.

start:

location to store the start value

end:

location to store the end value

Return type:

(bool, start: int, end: int)

Gets the start and end values for the range.

New in version 1.42.

ref()
Returns:

the input argument self object.

Return type:

NM.Range

Increases the reference count of the object. This is thread-safe.

New in version 1.42.

to_str()
Returns:

a string representing the range.

Return type:

str

Convert a NM.Range to a string.

New in version 1.42.

unref()

Decreases the reference count of the object. If the reference count reaches zero the object will be destroyed. This is thread-safe.

New in version 1.42.