From c8c6ca05c29698de5cc8875d86441d1b90e59c0f Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Tue, 20 Apr 2021 00:47:52 +0300 Subject: fix for older python versions --- mgs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mgs.py b/mgs.py index ddaccde..cd5e46c 100644 --- a/mgs.py +++ b/mgs.py @@ -1,6 +1,7 @@ import requests, textract, re, os, tempfile, random, string from argparse import ArgumentParser from bs4 import BeautifulSoup +from typing import List, Dict headers = { 'Referer': 'https://mos-gorsud.ru/', @@ -13,7 +14,7 @@ regex = r"""(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org| def strgen(n: int) -> str: return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(n)).lower() -def get_links(s: str) -> list[str]: +def get_links(s: str) -> List[str]: return list(set(re.findall(regex, s))) @@ -24,7 +25,7 @@ class MGSPiracy: self.from_page = from_page self.to_page = to_page - def get_cases(self) -> list[dict]: + def get_cases(self) -> List[Dict]: cases = [] for page in range(self.from_page, self.to_page+1): -- cgit v1.2.3