UniPRT SDK v1.0.0.0
 
Loading...
Searching...
No Matches
SettingsReadWrite.SettingsReadWrite Class Reference

Public Member Functions

 __init__ (self, connection=None, mgmt_comm=None, comm_descriptor=None)
 Must pass an opened TcpComm connection that can remain opened if listening for unsolicited msgs from printer.
 
 get_all_values (self)
 Read all settings key/value pairs.
 
str get_value_for_key (self, str key)
 Read setting associated with given key.
 
dict get_values_for_keys (self, list keys)
 Read multiple settings associated with given list of keys.
 
bool set_value (self, str value, str key)
 Write a setting value associated with given key.
 
bool set_values (self, dict keys_to_set)
 Write multiple settings associated with given keys.
 
Setting get_properties_for_key (self, str key)
 Read properties associated with the given key.
 
dict get_properties_for_keys (self, list keys)
 Read properties associated with the given list of keys.
 
dict get_all_properties (self)
 Read all properties.
 

Constructor & Destructor Documentation

◆ __init__()

SettingsReadWrite.SettingsReadWrite.__init__ ( self,
connection = None,
mgmt_comm = None,
comm_descriptor = None )

Must pass an opened TcpComm connection that can remain opened if listening for unsolicited msgs from printer.

A connection is necessary to send/receive printer status msgs.

Parameters
connectionThe TCP communication object.
mgmt_commThe JSON communication object.
comm_descriptorThe communication descriptor.
Returns
An initialized instance of SettingsReadWrite, or nil if the object could not be created.

Member Function Documentation

◆ get_all_properties()

dict SettingsReadWrite.SettingsReadWrite.get_all_properties ( self)

Read all properties.

Implemented in SettingsReadWrite.

Returns
A dictionary containing all keys and their corresponding Setting objects.

◆ get_all_values()

SettingsReadWrite.SettingsReadWrite.get_all_values ( self)

Read all settings key/value pairs.

Implemented in SettingsReadWrite.

Returns
A dictionary containing all settings keys and their corresponding values.

◆ get_properties_for_key()

Setting SettingsReadWrite.SettingsReadWrite.get_properties_for_key ( self,
str key )

Read properties associated with the given key.

Implemented in SettingsReadWrite.

Parameters
keyThe key for which to get the properties.
Returns
A Setting object containing the properties for the specified key.

◆ get_properties_for_keys()

dict SettingsReadWrite.SettingsReadWrite.get_properties_for_keys ( self,
list keys )

Read properties associated with the given list of keys.

Implemented in SettingsReadWrite.

Parameters
keysAn array of keys for which to get the properties.
Returns
A dictionary containing the specified keys and their corresponding Setting objects.

◆ get_value_for_key()

str SettingsReadWrite.SettingsReadWrite.get_value_for_key ( self,
str key )

Read setting associated with given key.

Implemented in SettingsReadWrite.

Parameters
keyThe key for which to get the value.
Returns
The value associated with the specified key.

◆ get_values_for_keys()

dict SettingsReadWrite.SettingsReadWrite.get_values_for_keys ( self,
list keys )

Read multiple settings associated with given list of keys.

Implemented in SettingsReadWrite.

Parameters
keysAn array of keys for which to get the values.
Returns
A dictionary containing the specified keys and their corresponding values.

◆ set_value()

bool SettingsReadWrite.SettingsReadWrite.set_value ( self,
str value,
str key )

Write a setting value associated with given key.

Returns true if write successful.

Note: A value that is intended to be processed as strings should be quoted. e.g. value = SomeString and value = "SomeString" will be sent exactly as received but may be handled differently by printer.

Implemented in SettingsReadWrite.

Parameters
valueThe value to set.
keyThe key for which to set the value.
Returns
YES if the value was successfully set, NO otherwise.

◆ set_values()

bool SettingsReadWrite.SettingsReadWrite.set_values ( self,
dict keys_to_set )

Write multiple settings associated with given keys.

Returns true if write successful.

Note: Values that are intended to be processed as strings should be quoted. e.g. value = SomeString and value = "SomeString" will be sent exactly as received but may be handled differently by printer.

Implemented in SettingsReadWrite.

Parameters
keys_to_setA dictionary containing the keys and values to set.
Returns
YES if the values were successfully set, NO otherwise.

The documentation for this class was generated from the following file: