Skip to content

Commit 0c3f593

Browse files
Amend the rest of doc strings according to PEP-0257
1 parent 1e230f3 commit 0c3f593

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

Xlib/ext/nvcontrol.py

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828

2929

3030
def query_target_count(self, target):
31-
"""return the target count"""
31+
"""Return the target count"""
3232
reply = NVCtrlQueryTargetCountReplyRequest(display=self.display,
3333
opcode=self.display.get_extension_major(extname),
3434
target_type=target.type())
3535
return int(reply._data.get('count'))
3636

3737

3838
def query_int_attribute(self, target, display_mask, attr):
39-
"""return the value of an integer attribute"""
39+
"""Return the value of an integer attribute"""
4040
reply = NVCtrlQueryAttributeReplyRequest(display=self.display,
4141
opcode=self.display.get_extension_major(extname),
4242
target_id=target.id(),
@@ -49,7 +49,7 @@ def query_int_attribute(self, target, display_mask, attr):
4949

5050

5151
def set_int_attribute(self, target, display_mask, attr, value):
52-
"""set the value of an integer attribute"""
52+
"""Set the value of an integer attribute"""
5353
reply = NVCtrlSetAttributeAndGetStatusReplyRequest(display=self.display,
5454
opcode=self.display.get_extension_major(extname),
5555
target_id=target.id(),
@@ -61,7 +61,7 @@ def set_int_attribute(self, target, display_mask, attr, value):
6161

6262

6363
def query_string_attribute(self, target, display_mask, attr):
64-
"""return the value of a string attribute"""
64+
"""Return the value of a string attribute"""
6565
reply = NVCtrlQueryStringAttributeReplyRequest(display=self.display,
6666
opcode=self.display.get_extension_major(extname),
6767
target_id=target.id(),
@@ -74,7 +74,7 @@ def query_string_attribute(self, target, display_mask, attr):
7474

7575

7676
def query_valid_attr_values(self, target, display_mask, attr):
77-
"""return the value of an integer attribute"""
77+
"""Return the value of an integer attribute"""
7878
reply = NVCtrlQueryValidAttributeValuesReplyRequest(display=self.display,
7979
opcode=self.display.get_extension_major(extname),
8080
target_id=target.id(),
@@ -87,7 +87,7 @@ def query_valid_attr_values(self, target, display_mask, attr):
8787

8888

8989
def query_binary_data(self, target, display_mask, attr):
90-
"""return binary data"""
90+
"""Return binary data"""
9191
reply = NVCtrlQueryBinaryDataReplyRequest(display=self.display,
9292
opcode=self.display.get_extension_major(extname),
9393
target_id=target.id(),
@@ -121,17 +121,17 @@ def get_gpu_count(self):
121121

122122

123123
def get_name(self, target):
124-
"""the GPU product name on which the specified X screen is running"""
124+
"""Return the GPU product name on which the specified X screen is running"""
125125
return query_string_attribute(self, target, 0, NV_CTRL_STRING_PRODUCT_NAME)
126126

127127

128128
def get_driver_version(self, target):
129-
"""the NVIDIA (kernel level) driver version for the specified screen or GPU"""
129+
"""Return the NVIDIA (kernel level) driver version for the specified screen or GPU"""
130130
return query_string_attribute(self, target, 0, NV_CTRL_STRING_NVIDIA_DRIVER_VERSION)
131131

132132

133133
def get_vbios_version(self, target):
134-
"""the version of the VBIOS for the specified screen or GPU"""
134+
"""Return the version of the VBIOS for the specified screen or GPU"""
135135
return query_string_attribute(self, target, 0, NV_CTRL_STRING_VBIOS_VERSION)
136136

137137

@@ -172,43 +172,46 @@ def get_irq(self, target):
172172

173173

174174
def supports_framelock(self, target):
175-
"""returns whether the underlying GPU supports Frame Lock.
175+
"""Return whether the underlying GPU supports Frame Lock.
176176
177-
All of the other frame lock attributes are only applicable if this returns True."""
177+
All of the other frame lock attributes are only applicable if this returns True.
178+
"""
178179
return query_int_attribute(self, target, 0, NV_CTRL_FRAMELOCK) == 1
179180

180181

181182
def gvo_supported(self, screen):
182-
"""returns whether this X screen supports GVO
183+
"""Return whether this X screen supports GVO
183184
184-
If this screen does not support GVO output, then all other GVO attributes are unavailable."""
185+
If this screen does not support GVO output, then all other GVO attributes are unavailable.
186+
"""
185187
return query_int_attribute(self, screen, [], NV_CTRL_GVO_SUPPORTED)
186188

187189

188190
def get_core_temp(self, target):
189-
"""return the current core temperature of the GPU driving the X screen."""
191+
"""Return the current core temperature of the GPU driving the X screen."""
190192
return query_int_attribute(self, target, 0, NV_CTRL_GPU_CORE_TEMPERATURE)
191193

192194

193195
def get_core_threshold(self, target):
194-
"""return the current GPU core slowdown threshold temperature.
196+
"""Return the current GPU core slowdown threshold temperature.
195197
196-
Itreflects the temperature at which the GPU is throttled to prevent overheating."""
198+
It reflects the temperature at which the GPU is throttled to prevent overheating.
199+
"""
197200
return query_int_attribute(self, target, 0, NV_CTRL_GPU_CORE_THRESHOLD)
198201

199202

200203
def get_default_core_threshold(self, target):
201-
"""return the default core threshold temperature."""
204+
"""Return the default core threshold temperature."""
202205
return query_int_attribute(self, target, 0, NV_CTRL_GPU_DEFAULT_CORE_THRESHOLD)
203206

204207

205208
def get_max_core_threshold(self, target):
206-
"""return the maximum core threshold temperature."""
209+
"""Return the maximum core threshold temperature."""
207210
return query_int_attribute(self, target, 0, NV_CTRL_GPU_MAX_CORE_THRESHOLD)
208211

209212

210213
def get_ambient_temp(self, target):
211-
"""return the current temperature in the immediate neighbourhood of the GPU driving the X screen."""
214+
"""Return the current temperature in the immediate neighbourhood of the GPU driving the X screen."""
212215
return query_int_attribute(self, target, 0, NV_CTRL_AMBIENT_TEMPERATURE)
213216

214217

@@ -297,16 +300,17 @@ def get_fan_rpm(self, target):
297300

298301

299302
def get_max_displays(self, target):
300-
"""return the maximum number of display devices that can be driven simultaneously on a GPU.
303+
"""Return the maximum number of display devices that can be driven simultaneously on a GPU.
301304
302305
Note that this does not indicate the maximum number of bits that can be set in
303306
NV_CTRL_CONNECTED_DISPLAYS, because more display devices can be connected than are actively
304-
in use."""
307+
in use.
308+
"""
305309
return query_int_attribute(self, target, 0, NV_CTRL_MAX_DISPLAYS)
306310

307311

308312
def _displaystr2num(st):
309-
"""return a display number from a string"""
313+
"""Return a display number from a string"""
310314
num = None
311315
for s, n in [('DFP-', 16), ('TV-', 8), ('CRT-', 0)]:
312316
if st.startswith(s):
@@ -324,7 +328,7 @@ def _displaystr2num(st):
324328

325329

326330
def _displays2mask(displays):
327-
"""return a display mask from an array of display numbers."""
331+
"""Return a display mask from an array of display numbers."""
328332
mask = 0
329333
for d in displays:
330334
mask += (1 << _displaystr2num(d))

0 commit comments

Comments
 (0)