File: device.rst

package info (click to toggle)
pyudev 0.13-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 468 kB
  • sloc: python: 2,481; makefile: 18
file content (126 lines) | stat: -rw-r--r-- 2,142 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
.. currentmodule:: pyudev

:class:`Device` – accessing device information
==============================================

.. autoclass:: Device()

   .. rubric:: Construction of device objects

   .. automethod:: from_path

   .. automethod:: from_sys_path

   .. automethod:: from_name

   .. automethod:: from_device_number

   .. automethod:: from_environment

   .. rubric:: General attributes

   .. attribute:: context

      The :class:`Context` to which this device is bound.

      .. versionadded:: 0.5

   .. autoattribute:: sys_path

   .. autoattribute:: sys_name

   .. autoattribute:: sys_number

   .. autoattribute:: device_path

   .. autoattribute:: tags

   .. rubric:: Device driver and subsystem

   .. autoattribute:: subsystem

   .. autoattribute:: driver

   .. autoattribute:: device_type

   .. rubric:: Device nodes

   .. autoattribute:: device_node

   .. autoattribute:: device_number

   .. autoattribute:: device_links

   .. rubric:: Device initialization time

   .. autoattribute:: is_initialized

   .. autoattribute:: time_since_initialized

   .. rubric:: Device hierarchy

   .. autoattribute:: parent

   .. autoattribute:: children

   .. automethod:: traverse

   .. automethod:: find_parent

   .. rubric:: Device properties

   .. automethod:: __iter__

   .. automethod:: __len__

   .. automethod:: __getitem__

   .. automethod:: asint

   .. automethod:: asbool

   .. rubric:: Sysfs attributes

   .. autoattribute:: attributes

.. autoclass:: Attributes()

   .. attribute:: device

      The :class:`Device` to which these attributes belong.

   .. automethod:: __iter__

   .. automethod:: __len__

   .. automethod:: __getitem__

   .. automethod:: asstring

   .. automethod:: asint

   .. automethod:: asbool

.. autoclass:: Tags()

   .. automethod:: __iter__

   .. automethod:: __contains__


Exceptions
----------

.. autoclass:: DeviceNotFoundError

.. autoclass:: DeviceNotFoundAtPathError
   :members:

.. autoclass:: DeviceNotFoundByNameError
   :members:

.. autoclass:: DeviceNotFoundByNumberError
   :members:

.. autoclass:: DeviceNotFoundInEnvironmentError
   :members: