def gettype(idx):
"""
returns the type of the device
:param idx: rfkill index
:returns: the type of the device
"""
fin = None
try:
fin = open(os.path.join(spath,"rfkill{0}".format(idx),'type'),'r')
return fin.read().strip()
except IOError:
raise pyric.error(errno.ENODEV,"No device at {0}".format(idx))
finally:
if fin: fin.close()
评论列表
文章目录