Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply black 2024 style to codebase #2168

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Pythonwin/pywin/framework/scriptutils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Various utilities for running/importing a script
"""

import bdb
import linecache
import os
Expand Down
1 change: 1 addition & 0 deletions Pythonwin/pywin/mfc/activex.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Support for ActiveX control hosting in Pythonwin.
"""

import win32ui
import win32uiole

Expand Down
1 change: 1 addition & 0 deletions Pythonwin/pywin/mfc/dialog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" \
Base class for Dialogs. Also contains a few useful utility functions
"""

# dialog.py
# Python class for Dialog Boxes in PythonWin.

Expand Down
1 change: 1 addition & 0 deletions adodbapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Copyright (C) 2002 Henrik Ekelund, version 2.1 by Vernon Cole
* http://sourceforge.net/projects/adodbapi
"""

import time

# Re-exports to keep backward compatibility with existing code
Expand Down
1 change: 1 addition & 0 deletions adodbapi/examples/db_table_names.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" db_table_names.py -- a simple demo for ADO database table listing."""

import sys

import adodbapi
Expand Down
1 change: 1 addition & 0 deletions adodbapi/is64bit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""is64bit.Python() --> boolean value of detected Python word size. is64bit.os() --> os build version"""

import sys


Expand Down
1 change: 1 addition & 0 deletions adodbapi/process_connect_string.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" a clumsy attempt at a macro language to let the programmer execute code on the server (ex: determine 64bit)"""

from . import is64bit as is64bit


Expand Down
1 change: 1 addition & 0 deletions adodbapi/schema_table.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""call using an open ADO connection --> list of table names"""

from . import adodbapi


Expand Down
1 change: 1 addition & 0 deletions adodbapi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Adodbapi can be run on CPython 3.5 and later.
or IronPython version 2.6 and later (in theory, possibly no longer in practice!)
"""

CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Expand Down
7 changes: 4 additions & 3 deletions adodbapi/test/adodbapitest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Unit tests version 2.6.1.0 for adodbapi"""

"""
adodbapi - A python DB API 2.0 interface to Microsoft ADO

Expand Down Expand Up @@ -251,9 +252,9 @@ def testUserDefinedConversionForExactNumericTypes(self):
)
finally:
# now reset the converter to its original function
adodbapi.variantConversions[
ado_consts.adNumeric
] = oldconverter # Restore the original convertion function
adodbapi.variantConversions[ado_consts.adNumeric] = (
oldconverter # Restore the original convertion function
)

def helpTestDataType(
self,
Expand Down
1 change: 1 addition & 0 deletions adodbapi/test/is64bit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""is64bit.Python() --> boolean value of detected Python word size. is64bit.os() --> os build version"""

import sys


Expand Down
6 changes: 3 additions & 3 deletions adodbapi/test/test_adodbapi_dbapi20.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
else:
conn_kws["host"] = host

conn_kws[
"provider"
] = "Provider=MSOLEDBSQL;DataTypeCompatibility=80;MARS Connection=True;"
conn_kws["provider"] = (
"Provider=MSOLEDBSQL;DataTypeCompatibility=80;MARS Connection=True;"
)
connStr = "%(provider)s; %(security)s; Initial Catalog=%(name)s;Data Source=%(host)s"

if onWindows and node != "z-PC":
Expand Down
1 change: 1 addition & 0 deletions com/win32com/client/CLSIDToClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
This obviously applies to all cooperating objects, not just DAO and
Access.
"""

mapCLSIDToClass = {}


Expand Down
1 change: 1 addition & 0 deletions com/win32com/client/combrowse.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
work.

"""

import sys

import pythoncom
Expand Down
1 change: 1 addition & 0 deletions com/win32com/client/connect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for working with Connections"""

import pythoncom
import win32com.server.util

Expand Down
1 change: 1 addition & 0 deletions com/win32com/client/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
>>> xl.Visible = 1 # The Excel window becomes visible.

"""

import traceback
import types

Expand Down
1 change: 1 addition & 0 deletions com/win32com/client/gencache.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Currently just uses a pickled dictionary, but should used some sort of indexed file.
Maybe an OLE2 compound file, or a bsddb file?
"""

import glob
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions com/win32com/client/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module contains utility functions, used primarily by advanced COM
programmers, or other COM modules.
"""

import pythoncom
from win32com.client import Dispatch, _get_good_object_

Expand Down
8 changes: 3 additions & 5 deletions com/win32com/makegw/makegw.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,9 @@ def _write_ifc_cpp(f, interface):
**strdict
)
)
argsParseTuple = (
argsCOM
) = (
formatChars
) = codePost = codePobjects = codeCobjects = cleanup = cleanup_gil = ""
argsParseTuple = argsCOM = formatChars = codePost = codePobjects = (
codeCobjects
) = cleanup = cleanup_gil = ""
needConversion = 0
# if method.name=="Stat": import win32dbg;win32dbg.brk()
for arg in method.args:
Expand Down
1 change: 1 addition & 0 deletions com/win32com/makegw/makegwenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
This module is notmally not used directly - the @makegw@ module
automatically calls this.
"""

#
# INTERNAL FUNCTIONS
#
Expand Down
1 change: 1 addition & 0 deletions com/win32com/makegw/makegwparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
See the @win32com.makegw@ module for information in building a COM
interface
"""

import re
import traceback

Expand Down
1 change: 1 addition & 0 deletions com/win32com/server/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

A collection of helpers for server side connection points.
"""

import pythoncom
import win32com.server.util
import winerror
Expand Down
1 change: 1 addition & 0 deletions com/win32com/server/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Please see policy.py for a discussion on dispatchers and policies
"""

import traceback
from sys import exc_info

Expand Down
1 change: 1 addition & 0 deletions com/win32com/server/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
This module provides a class which provides the necessary attributes.

"""

import sys

import pythoncom
Expand Down
1 change: 1 addition & 0 deletions com/win32com/server/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
problem, rather than a COM error.

"""

__author__ = "Greg Stein and Mark Hammond"

import sys
Expand Down
1 change: 1 addition & 0 deletions com/win32com/server/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
construct the necessary Python object, and dispatch COM events.

"""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions com/win32com/server/util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" General Server side utilities
"""

import pythoncom
import winerror

Expand Down
1 change: 0 additions & 1 deletion com/win32com/servers/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
next
"""


import pythoncom
import pywintypes
import winerror
Expand Down
1 change: 1 addition & 0 deletions com/win32com/servers/perfmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
set ob = CreateObject("Python.PerfmonQuery")
freeBytes = ob.Query("Memory", "Available Bytes")
"""

import pythoncom
import win32pdhutil
import winerror
Expand Down
1 change: 1 addition & 0 deletions com/win32com/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This module contains a collection of general purpose utility functions.
"""

import pythoncom
import win32api
import win32con
Expand Down
1 change: 1 addition & 0 deletions com/win32comext/axdebug/adb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""The glue between the Python debugger interface and the Active Debugger interface
"""

import _thread
import bdb
import os
Expand Down
1 change: 1 addition & 0 deletions com/win32comext/axdebug/contexts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" A module for managing the AXDebug I*Contexts

"""

from . import adb, axdebug, gateways

# Utility function for wrapping object created by this module.
Expand Down
1 change: 0 additions & 1 deletion com/win32comext/axdebug/documents.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
""" Management of documents for AXDebugging.
"""


import pythoncom
import win32api
from win32com.server.util import unwrap
Expand Down
1 change: 1 addition & 0 deletions com/win32comext/axscript/client/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

There are classes defined for the engine itself, and for ScriptItems
"""

import re
import sys

Expand Down
6 changes: 3 additions & 3 deletions com/win32comext/axscript/client/pyscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ def RegisterNamedItem(self, item):
if item.IsGlobal():
# Global items means sub-items are also added...
for subitem in item.subItems.values():
self.globalNameSpaceModule.__dict__[
subitem.name
] = subitem.attributeObject
self.globalNameSpaceModule.__dict__[subitem.name] = (
subitem.attributeObject
)
# Also add all methods
for name, entry in item.dispatchContainer._olerepr_.mapFuncs.items():
if not entry.hidden:
Expand Down
1 change: 1 addition & 0 deletions isapi/isapicon.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants needed by ISAPI filters and extensions."""

# ======================================================================
# Copyright 2002-2003 by Blackdog Software Pty Ltd.
#
Expand Down
1 change: 1 addition & 0 deletions isapi/threaded_extension.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""An ISAPI extension base class implemented using a thread-pool."""

# $Id$

import sys
Expand Down
1 change: 1 addition & 0 deletions pywin32_testall.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A test runner for pywin32"""

import os
import site
import subprocess
Expand Down
1 change: 0 additions & 1 deletion win32/Demos/security/sspi/socket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
See the SSPI documentation for more details.
"""


import http.client # sorry, this demo needs 2.3+
import optparse
import socketserver
Expand Down
1 change: 1 addition & 0 deletions win32/Demos/win32ts_logoff_disconnected.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Finds any disconnected terminal service sessions and logs them off"""

import pywintypes
import win32ts
import winerror
Expand Down
1 change: 1 addition & 0 deletions win32/Lib/sspi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
If you need finer control than offered here, just use the win32security
functions directly.
"""

# Based on Roger Upole's sspi demos.
# $Id$
import sspicon
Expand Down
1 change: 1 addition & 0 deletions win32/Lib/win32pdhquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
if you use it, you accept the risk of using it, etceteras.

"""

# Feb 12, 98 - MH added "rawaddcounter" so caller can get exception details.

import _thread
Expand Down
1 change: 1 addition & 0 deletions win32/Lib/winerror.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Generated by h2py from winerror.h
"""

# Few extras added manually...
TRUST_E_PROVIDER_UNKNOWN = -2146762751
TRUST_E_ACTION_UNKNOWN = -2146762750
Expand Down
1 change: 1 addition & 0 deletions win32/Lib/winxptheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
be available. In 2022, it's safe to assume they are, so this is just a wrapper
around _winxptheme.
"""

from _winxptheme import *
1 change: 1 addition & 0 deletions win32/test/test_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test pywin32's error semantics"""

import unittest

import pythoncom
Expand Down
8 changes: 5 additions & 3 deletions win32/test/test_win32crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ def open_windows_certstore(store_name: str, store_location: str) -> Iterator[Any
CERT_STORE_PROV_SYSTEM,
0,
None,
CERT_SYSTEM_STORE_LOCAL_MACHINE
if store_location == _LOCAL_MACHINE
else CERT_SYSTEM_STORE_CURRENT_USER,
(
CERT_SYSTEM_STORE_LOCAL_MACHINE
if store_location == _LOCAL_MACHINE
else CERT_SYSTEM_STORE_CURRENT_USER
),
store_name,
)
yield handle
Expand Down
1 change: 1 addition & 0 deletions win32/test/test_win32profile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test win32profile"""

import os
import unittest

Expand Down
Loading