Deprecate types-pywin32 in favor of pywin32-stubs
This commit is contained in:
parent
fe1b677f35
commit
72a1a10faa
@ -68,11 +68,13 @@ cups =
|
|||||||
pycups; platform_system!='Windows'
|
pycups; platform_system!='Windows'
|
||||||
win32 =
|
win32 =
|
||||||
pywin32; platform_system=='Windows'
|
pywin32; platform_system=='Windows'
|
||||||
|
pywin32-stubs; platform_system=='Windows'
|
||||||
all =
|
all =
|
||||||
pyusb>=1.0.0
|
pyusb>=1.0.0
|
||||||
pyserial
|
pyserial
|
||||||
pycups; platform_system!='Windows'
|
pycups; platform_system!='Windows'
|
||||||
pywin32; platform_system=='Windows'
|
pywin32; platform_system=='Windows'
|
||||||
|
pywin32-stubs; platform_system=='Windows'
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
exclude = .git,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py
|
exclude = .git,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py
|
||||||
|
@ -20,8 +20,8 @@ _DEP_WIN32PRINT = False
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import _win32typing
|
|
||||||
import pywintypes
|
import pywintypes
|
||||||
|
import win32helper.win32typing as _win32typing # pywin32-stubs package
|
||||||
import win32print
|
import win32print
|
||||||
|
|
||||||
_DEP_WIN32PRINT = True
|
_DEP_WIN32PRINT = True
|
||||||
@ -92,9 +92,7 @@ class Win32Raw(Escpos):
|
|||||||
"""Available Windows printers."""
|
"""Available Windows printers."""
|
||||||
return {
|
return {
|
||||||
printer["pPrinterName"]: printer
|
printer["pPrinterName"]: printer
|
||||||
for printer in win32print.EnumPrinters(
|
for printer in win32print.EnumPrinters(win32print.PRINTER_ENUM_NAME, "", 4)
|
||||||
win32print.PRINTER_ENUM_NAME, None, 4
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@dependency_win32print
|
@dependency_win32print
|
||||||
@ -124,7 +122,7 @@ class Win32Raw(Escpos):
|
|||||||
] = win32print.OpenPrinter(self.printer_name)
|
] = win32print.OpenPrinter(self.printer_name)
|
||||||
if self.device:
|
if self.device:
|
||||||
self.current_job = win32print.StartDocPrinter(
|
self.current_job = win32print.StartDocPrinter(
|
||||||
self.device, (job_name, None, "RAW"), 1
|
self.device, 1, (job_name, None, "RAW")
|
||||||
)
|
)
|
||||||
win32print.StartPagePrinter(self.device)
|
win32print.StartPagePrinter(self.device)
|
||||||
except (AssertionError, pywintypes.error) as e:
|
except (AssertionError, pywintypes.error) as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user