File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ def resources_handler(request):
392392 def _infos (resources : Iterator [Resource ]) -> List [Mapping [str , Any ]]:
393393 return list (filter (lambda i : 'State' in i and i ['State' ] is not None , [_info (r ) for r in resources ]))
394394
395- def _info (r : Resource ) -> List [ Mapping [str , Any ] ]:
395+ def _info (r : Resource ) -> Mapping [str , Any ]:
396396 nfo = r .info
397397 nfo ['Valid' ] = r .is_valid ()
398398 nfo ['Parser' ] = r .last_parser
Original file line number Diff line number Diff line change 1010from copy import deepcopy
1111from datetime import datetime
1212from threading import Condition , Lock
13- from typing import Optional , Dict
13+ from typing import Optional , Dict , Mapping , Any
1414
1515import requests
1616
@@ -247,8 +247,8 @@ def is_expired(self) -> bool:
247247 def is_valid (self ) -> bool :
248248 return not self .is_expired () and self .last_seen is not None and self .last_parser is not None
249249
250- def add_info (self ) -> Dict :
251- info = dict ()
250+ def add_info (self ) -> Mapping [ str , Optional [ Any ]] :
251+ info : Dict [ str , Optional [ Any ]] = dict ()
252252 info ['State' ] = None
253253 info ['Resource' ] = self .url
254254 self ._infos .append (info )
@@ -319,7 +319,7 @@ def save_backup(self):
319319
320320 def load_resource (self , getter ):
321321 data : Optional [str ] = None
322- status : Optional [ int ] = None
322+ status : int = 500
323323 info = self .add_info ()
324324
325325 log .debug ("Loading resource {}" .format (self .url ))
You can’t perform that action at this time.
0 commit comments