Skip to content

Commit

Permalink
Manual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Mar 25, 2024
1 parent 09bd384 commit 9e1111a
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Pythonwin/pywin/framework/intpyapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ def ProcessArgs(self, args, dde=None):
if dde:
dde.Exec(
"from pywin.framework import scriptutils\n"
"ed = scriptutils.GetActiveEditControl()\n"
"if ed: ed.SetSel(ed.LineIndex(%s - 1))" % gotoline
+ "ed = scriptutils.GetActiveEditControl()\n"
+ "if ed: ed.SetSel(ed.LineIndex(%s - 1))" % gotoline
)
else:
from . import scriptutils
Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/pywin/framework/mdi_pychecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def threadPycheckerRun(self):
elif not os.path.isfile(pychecker):
result = (
"Can't find checker.py - please install pychecker "
"(or run 'setup.py install' if you have the source version)\n"
+ "(or run 'setup.py install' if you have the source version)\n"
)
else:
cmd = f'{py} "{pychecker}" {options} {files} 2>&1'
Expand Down
4 changes: 2 additions & 2 deletions Pythonwin/pywin/scintilla/IDLEenvironment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def GetIDLEModule(module):
except ImportError as details:
msg = (
f"The IDLE extension '{module}' can not be located.\r\n\r\n"
"Please correct the installation and restart the"
f" application.\r\n\r\n{details}"
+ "Please correct the installation and restart the"
+ f" application.\r\n\r\n{details}"
)
win32ui.MessageBox(msg)
return None
Expand Down
4 changes: 2 additions & 2 deletions com/win32com/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def CastTo(ob, target, typelib=None):
if not hasattr(mod, target):
raise ValueError(
f"The interface name '{target}' does not appear in the "
f"specified library {typelib.ver_desc!r}"
+ f"specified library {typelib.ver_desc!r}"
)

elif hasattr(target, "index"): # string like
Expand Down Expand Up @@ -199,7 +199,7 @@ def CastTo(ob, target, typelib=None):
if target_clsid is None:
raise ValueError(
f"The interface name '{target}' does not appear in the "
f"same library as object '{ob!r}'"
+ f"same library as object '{ob!r}'"
)
mod = gencache.GetModuleForCLSID(target_clsid)
if mod is not None:
Expand Down
4 changes: 2 additions & 2 deletions com/win32com/client/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def __init__(
def __repr__(self):
return (
f"MapEntry(dispid={self.dispid}, desc={self.desc}, names={self.names}, doc={self.doc!r}, "
f"resultCLSID={self.resultCLSID}, resultDocumentation={self.resultDocumentation}, "
f"wasProperty={self.wasProperty}, hidden={self.hidden}"
+ f"resultCLSID={self.resultCLSID}, resultDocumentation={self.resultDocumentation}, "
+ f"wasProperty={self.wasProperty}, hidden={self.hidden}"
)

def GetResultCLSID(self):
Expand Down
2 changes: 1 addition & 1 deletion com/win32com/server/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def _CreateInstance_(self, clsid, reqIID):

desc = (
f"The object '{myob!r}' was created, but does not support the "
f"interface '{IIDToInterfaceName(reqIID)}'({reqIID}): {desc}"
+ f"interface '{IIDToInterfaceName(reqIID)}'({reqIID}): {desc}"
)
raise pythoncom.com_error(hr, desc, exc, arg)

Expand Down
2 changes: 1 addition & 1 deletion com/win32comext/adsi/demos/scp.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def AllowAccessToScpProperties(
setattr(scpObject, attribute, sd)
# SetInfo updates the SCP object in the directory.
scpObject.SetInfo()
logger.info(f"Set security on object for account '{trustee}'")
logger.info("Set security on object for account %r", trustee)


# Service Principal Names functions from the same sample.
Expand Down
3 changes: 1 addition & 2 deletions com/win32comext/shell/demos/explorer_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ def __init__(self):
except pythoncom.com_error as exc:
# this should really only fail if no "nav" frame exists...
print(
"Strange - failed to get the tree control even though "
"we asked for a EBO_SHOWFRAMES"
"Strange - failed to get the tree control even though we asked for a EBO_SHOWFRAMES"
)
print(exc)
else:
Expand Down
4 changes: 2 additions & 2 deletions com/win32comext/shell/demos/servers/folder_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ def DllRegisterServer():

key = winreg.CreateKey(
winreg.HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
"Explorer\\Desktop\\Namespace\\" + ShellFolder._reg_clsid_,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\Namespace\\"
+ ShellFolder._reg_clsid_,
)
winreg.SetValueEx(key, None, 0, winreg.REG_SZ, ShellFolder._reg_desc_)
# And special shell keys under our CLSID
Expand Down
8 changes: 4 additions & 4 deletions com/win32comext/shell/demos/servers/shell_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,8 @@ def DllRegisterServer():

key = winreg.CreateKey(
winreg.HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
"Explorer\\Desktop\\Namespace\\" + ShellFolderRoot._reg_clsid_,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\Namespace\\"
+ ShellFolderRoot._reg_clsid_,
)
winreg.SetValueEx(key, None, 0, winreg.REG_SZ, ShellFolderRoot._reg_desc_)
# And special shell keys under our CLSID
Expand All @@ -950,8 +950,8 @@ def DllUnregisterServer():
try:
key = winreg.DeleteKey(
winreg.HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
"Explorer\\Desktop\\Namespace\\" + ShellFolderRoot._reg_clsid_,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\Namespace\\"
+ ShellFolderRoot._reg_clsid_,
)
except OSError as details:
import errno
Expand Down
2 changes: 1 addition & 1 deletion isapi/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ def HandleCommandLine(
"--server",
action="store",
help="Specifies the IIS server to install/uninstall on."
f" Default is '{_IIS_OBJECT}/1'",
+ f" Default is '{_IIS_OBJECT}/1'",
)

(options, args) = parser.parse_args(argv[1:])
Expand Down
8 changes: 4 additions & 4 deletions pywin32_postinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def CopyTo(desc, src, dest):
raise
full_desc = (
f"Error {desc}\n\n"
"If you have any Python applications running, "
f"please close them now\nand select 'Retry'\n\n{details.strerror}"
+ "If you have any Python applications running, "
+ f"please close them now\nand select 'Retry'\n\n{details.strerror}"
)
rc = win32api.MessageBox(
0, full_desc, "Installation Error", win32con.MB_ABORTRETRYIGNORE
Expand Down Expand Up @@ -472,8 +472,8 @@ def install(lib_dir):
if os.path.exists(dst):
msg = (
"The file '%s' exists, but can not be replaced "
"due to insufficient permissions. You must "
"reinstall this software as an Administrator" % dst
+ "due to insufficient permissions. You must "
+ "reinstall this software as an Administrator" % dst
)
print(msg)
raise RuntimeError(msg)
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2179,7 +2179,7 @@ def convert_optional_data_files(files):
except RuntimeError as details:
if not str(details.args[0]).startswith("No file"):
raise
logging.info("NOTE: Optional file %s not found - skipping" % file)
logging.info("NOTE: Optional file %s not found - skipping", file)
else:
ret.append(temp[0])
return ret
Expand Down Expand Up @@ -2285,9 +2285,9 @@ def maybe_fixup_exes():
# keep it short and sweet as it's the first thing shown by the UI.
long_description = (
"Python extensions for Microsoft Windows\n"
"Provides access to much of the Win32 API, the\n"
"ability to create and use COM objects, and the\n"
"Pythonwin environment."
+ "Provides access to much of the Win32 API, the\n"
+ "ability to create and use COM objects, and the\n"
+ "Pythonwin environment."
)
long_description_content_type = "text/plain"
else:
Expand Down
6 changes: 3 additions & 3 deletions win32/Demos/NetValidatePasswordPolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def main():
"--password",
action="store",
help="The clear-text password to pass to the function "
"(only for the 'change' command)",
+ "(only for the 'change' command)",
)

parser.add_option(
Expand All @@ -60,8 +60,8 @@ def main():
action="store_false",
default=True,
help="Used to specify the password does NOT match (ie, "
"uses False for the PasswordMatch/PasswordMatched "
"arg, both 'auth' and 'change' commands)",
+ "uses False for the PasswordMatch/PasswordMatched "
+ "arg, both 'auth' and 'change' commands)",
)

parser.add_option(
Expand Down
8 changes: 4 additions & 4 deletions win32/Lib/win32gui_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def UnpackMENUITEMINFO(s):
text = None
return _MakeResult(
"MENUITEMINFO fType fState wID hSubMenu hbmpChecked "
"hbmpUnchecked dwItemData text hbmpItem",
+ "hbmpUnchecked dwItemData text hbmpItem",
(
fType,
fState,
Expand Down Expand Up @@ -502,7 +502,7 @@ def UnpackTVITEM(buffer):
text = None
return _MakeResult(
"TVITEM item_hItem item_state item_stateMask "
"text item_image item_selimage item_cChildren item_param",
+ "text item_image item_selimage item_cChildren item_param",
(
item_hItem,
item_state,
Expand Down Expand Up @@ -642,7 +642,7 @@ def UnpackLVITEM(buffer):
text = None
return _MakeResult(
"LVITEM item_item item_subItem item_state "
"item_stateMask text item_image item_param item_indent",
+ "item_stateMask text item_image item_param item_indent",
(
item_item,
item_subItem,
Expand Down Expand Up @@ -687,7 +687,7 @@ def UnpackLVNOTIFY(lparam):
) = struct.unpack(format, buf)
return _MakeResult(
"UnpackLVNOTIFY hwndFrom id code item subitem "
"newstate oldstate changed pt lparam",
+ "newstate oldstate changed pt lparam",
(
hwndFrom,
id,
Expand Down
3 changes: 1 addition & 2 deletions win32/test/test_win32trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def CheckNoOtherReaders():
win32trace.TermRead()
win32trace.TermWrite()
raise RuntimeError(
"An existing win32trace reader appears to be "
"running - please stop this process and try again"
"An existing win32trace reader appears to be running - please stop this process and try again"
)


Expand Down

0 comments on commit 9e1111a

Please sign in to comment.