Skip to content

Commit

Permalink
#2031 Remove Invalid Type Hint
Browse files Browse the repository at this point in the history
Also updates Observer type hints based on gorakhargosh/watchdog#982
  • Loading branch information
Rixxan committed Jul 23, 2023
1 parent 8763e9f commit bd822f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import tkinter as tk
from calendar import timegm
from os.path import getsize, isdir, isfile
from typing import Any, Dict, Optional
from typing import Any, Dict, Optional, cast

from watchdog.observers.api import BaseObserver

from config import config
from EDMCLogging import get_main_logger
Expand Down Expand Up @@ -87,7 +89,7 @@ def start(self, root: tk.Tk, started: int) -> bool:

if not self.observed and not (sys.platform != 'win32'):
logger.debug('Starting observer...')
self.observed = self.observer.schedule(self, self.currentdir)
self.observed = cast(BaseObserver, self.observer).schedule(self, self.currentdir)
logger.debug('Done')

logger.info(f'{(sys.platform != "win32") and "Polling" or "Monitoring"} Dashboard "{self.currentdir}"')
Expand Down
2 changes: 1 addition & 1 deletion debug_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class LoggingHandler(server.BaseHTTPRequestHandler):
"""HTTP Handler implementation that logs to EDMCs logger and writes data to files on disk."""

def __init__(self, request: bytes, client_address: Tuple[str, int], server) -> None:
def __init__(self, request, client_address: Tuple[str, int], server) -> None:
super().__init__(request, client_address, server)

def log_message(self, format: str, *args: Any) -> None:
Expand Down

0 comments on commit bd822f7

Please sign in to comment.