1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-12-02 09:43:30 +00:00

Add default value to all params + type annotations

This commit is contained in:
belono
2023-09-03 20:37:41 +02:00
parent fa583e68d5
commit a7e7bc0a64
8 changed files with 33 additions and 20 deletions

View File

@@ -9,6 +9,7 @@
"""
import socket
from typing import Union
from ..escpos import Escpos
@@ -50,7 +51,14 @@ class Network(Escpos):
"""
return is_usable()
def __init__(self, host, port=9100, timeout=60, *args, **kwargs):
def __init__(
self,
host: str = None,
port: int = 9100,
timeout: Union[int, float] = 60,
*args,
**kwargs
):
"""Initialize network printer.
:param host: Printer's hostname or IP address