Skip to content

Commit b74bfdc

Browse files
committed
Run ruff format
1 parent b9256ff commit b74bfdc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+202
-268
lines changed

AutoDuck/Dump2HHC.py

+7-21
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,7 @@ def _genItemsFromDict(dict, cat, output, target, do_children=1):
293293
<param name="ImageNumber" value="1">
294294
<param name="Local" value="{CHM}{context}">
295295
</OBJECT>
296-
""".format(
297-
**locals()
298-
)
296+
""".format(**locals())
299297
)
300298
if not do_children:
301299
continue
@@ -339,9 +337,7 @@ def genTOC(cats, output, title, target):
339337
<param name="Local" value="{CHM}{target}.html">
340338
</OBJECT>
341339
<UL>
342-
""".format(
343-
**locals()
344-
)
340+
""".format(**locals())
345341
)
346342

347343
for cat in cats:
@@ -355,9 +351,7 @@ def genTOC(cats, output, title, target):
355351
<param name="Local" value="{CHM}{cat_id}.html">
356352
</OBJECT>
357353
<UL>
358-
""".format(
359-
**locals()
360-
)
354+
""".format(**locals())
361355
)
362356
# Next write the overviews for this category
363357
output.write(
@@ -368,9 +362,7 @@ def genTOC(cats, output, title, target):
368362
<param name="Local" value="{CHM}{cat_id}_overview.html">
369363
</OBJECT>
370364
<UL>
371-
""".format(
372-
**locals()
373-
)
365+
""".format(**locals())
374366
)
375367
_genItemsFromDict(cat.overviewTopics, cat, output, target)
376368
_genItemsFromDict(cat.extOverviewTopics, cat, output, target)
@@ -387,9 +379,7 @@ def genTOC(cats, output, title, target):
387379
<param name="Local" value="{CHM}{cat_id}_modules.html">
388380
</OBJECT>
389381
<UL>
390-
""".format(
391-
**locals()
392-
)
382+
""".format(**locals())
393383
)
394384
_genItemsFromDict(cat.modules, cat, output, target)
395385
output.write(
@@ -404,9 +394,7 @@ def genTOC(cats, output, title, target):
404394
<param name="ImageNumber" value="1">
405395
<param name="Local" value="{CHM}{cat_id}_objects.html">
406396
</OBJECT>
407-
<UL>""".format(
408-
**locals()
409-
)
397+
<UL>""".format(**locals())
410398
)
411399
# Don't show 'children' for objects - params etc don't need their own child nodes!
412400
_genItemsFromDict(cat.objects, cat, output, target, do_children=0)
@@ -423,9 +411,7 @@ def genTOC(cats, output, title, target):
423411
<param name="Local" value="{CHM}{cat_id}_constants.html">
424412
</OBJECT>
425413
<UL>
426-
""".format(
427-
**locals()
428-
)
414+
""".format(**locals())
429415
)
430416
_genItemsFromDict(cat.constants, cat, output, target)
431417
output.write(

Pythonwin/pywin/dialogs/list.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,17 @@ def OnListClick(self, id, code):
4444
return 1
4545

4646
def OnListItemChange(self, std, extra):
47-
(hwndFrom, idFrom, code), (
48-
itemNotify,
49-
sub,
50-
newState,
51-
oldState,
52-
change,
53-
point,
54-
lparam,
47+
(
48+
(hwndFrom, idFrom, code),
49+
(
50+
itemNotify,
51+
sub,
52+
newState,
53+
oldState,
54+
change,
55+
point,
56+
lparam,
57+
),
5558
) = (std, extra)
5659
oldSel = (oldState & commctrl.LVIS_SELECTED) != 0
5760
newSel = (newState & commctrl.LVIS_SELECTED) != 0

Pythonwin/pywin/framework/app.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# The application is responsible for managing the main frame window.
33
#
44
# We also grab the FileOpen command, to invoke our Python editor
5-
" The PythonWin application code. Manages most aspects of MDI, etc "
5+
"The PythonWin application code. Manages most aspects of MDI, etc"
6+
67
from __future__ import annotations
78

89
import os

Pythonwin/pywin/framework/scriptutils.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
debugging_options = """No debugging
2828
Step-through in the debugger
2929
Run in the debugger
30-
Post-Mortem of unhandled exceptions""".split(
31-
"\n"
32-
)
30+
Post-Mortem of unhandled exceptions""".split("\n")
3331

3432
byte_cr = b"\r"
3533
byte_lf = b"\n"

Pythonwin/pywin/framework/stdin.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import sys
1717
sys.stdin = sys.stdin.real_file
1818
"""
19+
1920
import sys
2021

2122
get_input_line = input

Pythonwin/pywin/mfc/activex.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Support for ActiveX control hosting in Pythonwin.
2-
"""
1+
"""Support for ActiveX control hosting in Pythonwin."""
32

43
import win32ui
54
import win32uiole

adodbapi/examples/db_print.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" db_print.py -- a simple demo for ADO database reads."""
1+
"""db_print.py -- a simple demo for ADO database reads."""
22

33
import sys
44

adodbapi/examples/db_table_names.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" db_table_names.py -- a simple demo for ADO database table listing."""
1+
"""db_table_names.py -- a simple demo for ADO database table listing."""
22

33
import sys
44

adodbapi/process_connect_string.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" a clumsy attempt at a macro language to let the programmer execute code on the server (ex: determine 64bit)"""
1+
"""a clumsy attempt at a macro language to let the programmer execute code on the server (ex: determine 64bit)"""
22

33
from . import is64bit
44

adodbapi/test/adodbapitest.py

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Unit tests version 2.6.1.0 for adodbapi"""
1+
"""Unit tests version 2.6.1.0 for adodbapi"""
22

33
"""
44
adodbapi - A python DB API 2.0 interface to Microsoft ADO
@@ -325,15 +325,16 @@ def helpTestDataType(
325325
rs = crsr.fetchone()
326326
if allowedReturnValues:
327327
allowedTypes = tuple([type(aRV) for aRV in allowedReturnValues])
328-
assert isinstance(
329-
rs[0], allowedTypes
330-
), 'result type "%s" must be one of %s' % (type(rs[0]), allowedTypes)
328+
assert isinstance(rs[0], allowedTypes), (
329+
'result type "%s" must be one of %s' % (type(rs[0]), allowedTypes)
330+
)
331331
else:
332-
assert isinstance(
333-
rs[0], type(pyData)
334-
), 'result type "%s" must be instance of %s' % (
335-
type(rs[0]),
336-
type(pyData),
332+
assert isinstance(rs[0], type(pyData)), (
333+
'result type "%s" must be instance of %s'
334+
% (
335+
type(rs[0]),
336+
type(pyData),
337+
)
337338
)
338339

339340
if compareAlmostEqual and DBAPIDataTypeString == "DATETIME":
@@ -343,9 +344,9 @@ def helpTestDataType(
343344
elif compareAlmostEqual:
344345
s = float(pyData)
345346
v = float(rs[0])
346-
assert (
347-
abs(v - s) / s < 0.00001
348-
), "Values not almost equal recvd=%s, expected=%f" % (rs[0], s)
347+
assert abs(v - s) / s < 0.00001, (
348+
"Values not almost equal recvd=%s, expected=%f" % (rs[0], s)
349+
)
349350
else:
350351
if allowedReturnValues:
351352
ok = False
@@ -487,7 +488,7 @@ def testDataTypeDate(self):
487488
)
488489

489490
def testDataTypeBinary(self):
490-
binfld = b"\x07\x00\xE2\x40*"
491+
binfld = b"\x07\x00\xe2\x40*"
491492
arv = [binfld, adodbapi.Binary(binfld), bytes(binfld)]
492493
if self.getEngine() == "PostgreSQL":
493494
self.helpTestDataType(
@@ -692,9 +693,9 @@ def testRowIterator(self):
692693
rec = crsr.fetchone()
693694
# check that stepping through an emulated row works
694695
for j in range(len(inParam)):
695-
assert (
696-
rec[j] == inParam[j]
697-
), 'returned value:"%s" != test value:"%s"' % (rec[j], inParam[j])
696+
assert rec[j] == inParam[j], (
697+
'returned value:"%s" != test value:"%s"' % (rec[j], inParam[j])
698+
)
698699
# check that we can get a complete tuple from a row
699700
assert (
700701
tuple(rec) == inParam

adodbapi/test/dbapi20.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env python
2-
""" Python DB API 2.0 driver compliance unit test suite.
2+
"""Python DB API 2.0 driver compliance unit test suite.
33
4-
This software is Public Domain and may be used without restrictions.
4+
This software is Public Domain and may be used without restrictions.
55
6-
"Now we have booze and barflies entering the discussion, plus rumours of
7-
DBAs on drugs... and I won't tell you what flashes through my mind each
8-
time I read the subject line with 'Anal Compliance' in it. All around
9-
this is turning out to be a thoroughly unwholesome unit test."
6+
"Now we have booze and barflies entering the discussion, plus rumours of
7+
DBAs on drugs... and I won't tell you what flashes through my mind each
8+
time I read the subject line with 'Anal Compliance' in it. All around
9+
this is turning out to be a thoroughly unwholesome unit test."
1010
11-
-- Ian Bicking
11+
-- Ian Bicking
1212
"""
1313

1414
__version__ = "$Revision: 1.15.0 $"[11:-2]

adodbapi/test/setuptestframework.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/python2
22
# Configure this in order to run the testcases.
33
"setuptestframework.py v 2.6.0.8"
4+
45
import os
56
import shutil
67
import tempfile

com/win32com/client/combrowse.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
"""A utility for browsing COM objects.
22
3-
Usage:
3+
Usage:
44
5-
Command Prompt
5+
Command Prompt
66
7-
Use the command *"python.exe combrowse.py"*. This will display
8-
display a fairly small, modal dialog.
7+
Use the command *"python.exe combrowse.py"*. This will display
8+
display a fairly small, modal dialog.
99
10-
Pythonwin
10+
Pythonwin
1111
12-
Use the "Run Script" menu item, and this will create the browser in an
13-
MDI window. This window can be fully resized.
12+
Use the "Run Script" menu item, and this will create the browser in an
13+
MDI window. This window can be fully resized.
1414
15-
Details
15+
Details
1616
17-
This module allows browsing of registered Type Libraries, COM categories,
18-
and running COM objects. The display is similar to the Pythonwin object
19-
browser, and displays the objects in a hierarchical window.
17+
This module allows browsing of registered Type Libraries, COM categories,
18+
and running COM objects. The display is similar to the Pythonwin object
19+
browser, and displays the objects in a hierarchical window.
2020
21-
Note that this module requires the win32ui (ie, Pythonwin) distribution to
22-
work.
21+
Note that this module requires the win32ui (ie, Pythonwin) distribution to
22+
work.
2323
2424
"""
2525

@@ -581,7 +581,6 @@ def GetSubList(self):
581581

582582

583583
def main(modal=True, mdi=False):
584-
585584
root = HLIRoot("COM Browser")
586585
if mdi and "pywin.framework.app" in sys.modules:
587586
# do it in a MDI window

com/win32com/client/dynamic.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,10 @@ def _get_good_object_(self, ob, userName=None, ReturnCLSID=None):
389389
elif isinstance(ob, tuple):
390390
return tuple(
391391
map(
392-
lambda o, s=self, oun=userName, rc=ReturnCLSID: s._get_good_single_object_(
393-
o, oun, rc
394-
),
392+
lambda o,
393+
s=self,
394+
oun=userName,
395+
rc=ReturnCLSID: s._get_good_single_object_(o, oun, rc),
395396
ob,
396397
)
397398
)

com/win32com/client/genpy.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -969,9 +969,7 @@ def _Build_Interface(self, type_info_tuple):
969969
return oleItem, vtableItem
970970

971971
def BuildOleItemsFromType(self):
972-
assert (
973-
self.bBuildHidden
974-
), "This code doesn't look at the hidden flag - I thought everyone set it true!?!?!"
972+
assert self.bBuildHidden, "This code doesn't look at the hidden flag - I thought everyone set it true!?!?!"
975973
oleItems = {}
976974
enumItems = {}
977975
recordItems = {}

com/win32com/client/makepy.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
"""Generate a .py file from an OLE TypeLibrary file.
1616
1717
18-
This module is concerned only with the actual writing of
19-
a .py file. It draws on the @build@ module, which builds
20-
the knowledge of a COM interface.
18+
This module is concerned only with the actual writing of
19+
a .py file. It draws on the @build@ module, which builds
20+
the knowledge of a COM interface.
2121
2222
"""
23+
2324
usageHelp = """ \
2425
2526
Usage:

com/win32com/client/selecttlb.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Utilities for selecting and enumerating the Type Libraries installed on the system
2-
"""
1+
"""Utilities for selecting and enumerating the Type Libraries installed on the system"""
32

43
import pythoncom
54
import win32api

0 commit comments

Comments
 (0)