|
8 | 8 | import time |
9 | 9 | from collections import defaultdict |
10 | 10 | from operator import itemgetter |
| 11 | +from typing import Dict, List, Set |
11 | 12 |
|
12 | 13 | from channelfinder import ChannelFinderClient |
13 | 14 | from requests import ConnectionError, RequestException |
@@ -397,15 +398,15 @@ def dict_to_file(dict, iocs, conf): |
397 | 398 | json.dump(list, f) |
398 | 399 |
|
399 | 400 |
|
400 | | -def create_channel(name: str, owner: str, properties: list[dict[str, str]]): |
| 401 | +def create_channel(name: str, owner: str, properties: List[Dict[str, str]]): |
401 | 402 | return { |
402 | 403 | "name": name, |
403 | 404 | "owner": owner, |
404 | 405 | "properties": properties, |
405 | 406 | } |
406 | 407 |
|
407 | 408 |
|
408 | | -def create_property(owner: str, name: str, value: str): |
| 409 | +def create_property(owner: str, name: str, value: str) -> Dict[str, str]: |
409 | 410 | return { |
410 | 411 | "name": name, |
411 | 412 | "owner": owner, |
@@ -741,8 +742,8 @@ def create_default_properties(owner, iocTime, recceiverid, channels_dict, iocs, |
741 | 742 |
|
742 | 743 |
|
743 | 744 | def __merge_property_lists( |
744 | | - newProperties: list[dict[str, str]], channel: dict[str, list[dict[str, str]]], managed_properties=set() |
745 | | -) -> list[dict[str, str]]: |
| 745 | + newProperties: List[Dict[str, str]], channel: Dict[str, List[Dict[str, str]]], managed_properties: Set[str] = set() |
| 746 | +) -> List[Dict[str, str]]: |
746 | 747 | """ |
747 | 748 | Merges two lists of properties ensuring that there are no 2 properties with |
748 | 749 | the same name In case of overlap between the new and old property lists the |
|
0 commit comments