from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from ....Internal.Utilities import trim_str_response
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class UnameCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("uname", core, parent)
[docs]
def set(self, user_name: str, ndrive=repcap.Ndrive.Default) -> None:
"""
``MMEMory:NDRive<*>:UNAMe`` \n
Snippet: ``driver.massMemory.ndrive.uname.set(user_name = 'abc', ndrive = repcap.Ndrive.Default)`` \n
Sets the user name that is used to access the network folder.
:param user_name: String with the user name
:param ndrive: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Ndrive')
"""
param = Conversions.value_to_quoted_str(user_name)
ndrive_cmd_val = self._cmd_group.get_repcap_cmd_value(ndrive, repcap.Ndrive)
self._core.io.write(f'MMEMory:NDRive{ndrive_cmd_val}:UNAMe {param}')
[docs]
def get(self, ndrive=repcap.Ndrive.Default) -> str:
"""
``MMEMory:NDRive<*>:UNAMe`` \n
Snippet: ``value: str = driver.massMemory.ndrive.uname.get(ndrive = repcap.Ndrive.Default)`` \n
Sets the user name that is used to access the network folder.
:param ndrive: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Ndrive')
:return: user_name: String with the user name
"""
ndrive_cmd_val = self._cmd_group.get_repcap_cmd_value(ndrive, repcap.Ndrive)
response = self._core.io.query_str(f'MMEMory:NDRive{ndrive_cmd_val}:UNAMe?')
return trim_str_response(response)