mirror of
				https://github.com/python-escpos/python-escpos
				synced 2025-10-23 09:30:00 +00:00 
			
		
		
		
	Deprecate types-pywin32 in favor of pywin32-stubs
This commit is contained in:
		| @@ -68,11 +68,13 @@ cups = | ||||
|     pycups; platform_system!='Windows' | ||||
| win32 = | ||||
|     pywin32; platform_system=='Windows' | ||||
|     pywin32-stubs; platform_system=='Windows' | ||||
| all = | ||||
|     pyusb>=1.0.0 | ||||
|     pyserial | ||||
|     pycups; platform_system!='Windows' | ||||
|     pywin32; platform_system=='Windows' | ||||
|     pywin32-stubs; platform_system=='Windows' | ||||
|  | ||||
| [flake8] | ||||
| 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: | ||||
|     import _win32typing | ||||
|     import pywintypes | ||||
|     import win32helper.win32typing as _win32typing  # pywin32-stubs package | ||||
|     import win32print | ||||
|  | ||||
|     _DEP_WIN32PRINT = True | ||||
| @@ -92,9 +92,7 @@ class Win32Raw(Escpos): | ||||
|         """Available Windows printers.""" | ||||
|         return { | ||||
|             printer["pPrinterName"]: printer | ||||
|             for printer in win32print.EnumPrinters( | ||||
|                 win32print.PRINTER_ENUM_NAME, None, 4 | ||||
|             ) | ||||
|             for printer in win32print.EnumPrinters(win32print.PRINTER_ENUM_NAME, "", 4) | ||||
|         } | ||||
|  | ||||
|     @dependency_win32print | ||||
| @@ -124,7 +122,7 @@ class Win32Raw(Escpos): | ||||
|             ] = win32print.OpenPrinter(self.printer_name) | ||||
|             if self.device: | ||||
|                 self.current_job = win32print.StartDocPrinter( | ||||
|                     self.device, (job_name, None, "RAW"), 1 | ||||
|                     self.device, 1, (job_name, None, "RAW") | ||||
|                 ) | ||||
|                 win32print.StartPagePrinter(self.device) | ||||
|         except (AssertionError, pywintypes.error) as e: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 belono
					belono