1- """Kickoff functions for getting instancs of device objects.
2- """
1+ """Kickoff functions for getting instancs of device objects."""
32
43import os
54import warnings
2221
2322
2423def ntc_device (device_type , * args , ** kwargs ):
25- """Instantiate and return an instance of a device subclassed
26- from ``pyntc.devices.BaseDevice``. ``*args`` and ``*kwargs`` are passed
27- directly to the device initializer.
24+ """
25+ Instantiate an instance of a ``pyntc.devices.BaseDevice`` by ``device_type``.
26+
27+ The ``*args`` and ``*kwargs`` are passed directly to the device initializer.
2828
2929 Arguments:
3030 device_type (string): A valid device_type
@@ -36,7 +36,6 @@ def ntc_device(device_type, *args, **kwargs):
3636 Raises:
3737 UnsupportedDeviceError: if the device_type is unsupported.
3838 """
39-
4039 try :
4140 device_class = supported_devices [device_type ]
4241 return device_class (* args , ** kwargs )
@@ -45,9 +44,8 @@ def ntc_device(device_type, *args, **kwargs):
4544
4645
4746def ntc_device_by_name (name , filename = None ):
48- """Instantiate and return an instance of a device subclassed
49- from ``pyntc.devices.BaseDevice`` based on its name in an
50- NTC configuration file.
47+ """
48+ Instantiate an instance of a ``pyntc.devices.BaseDevice`` from ntc.conf file.
5149
5250 If no filename is given the environment variable PYNTC_CONF is checked
5351 for a path, and then ~/.ntc.conf.
@@ -58,9 +56,8 @@ def ntc_device_by_name(name, filename=None):
5856 the ``name`` argument as section header.
5957
6058 Raises:
61- DeviceNameNotFoundError: if the name is not found in the
62- NTC configuration file.
63- ConfFileNotFoundError: if no NTC configuration can be found.
59+ DeviceNameNotFoundError: If the name is not found in the NTC configuration file.
60+ ConfFileNotFoundError: If no NTC configuration can be found.
6461 """
6562 config , filename = _get_config_from_file (filename = filename )
6663 sections = config .sections ()
0 commit comments