Skip to content

Commit c226c00

Browse files
committed
pc
1 parent 85fa6a9 commit c226c00

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/pre-commit.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919

2020
- name: Install dependencies
2121
run: |
22+
python -m pip install types-PyYAML types-requests
2223
python -m pip install --upgrade pip
2324
python -m pip install pre-commit
2425
pre-commit install-hooks

config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import requests
44

55
from datetime import datetime, timedelta
6+
from typing import Dict, Any
67

78
# Rutas a los archivos de configuración
89
CONFIG_PATH = "data/config.yaml"
@@ -15,7 +16,7 @@
1516
domain_percentage_table = {}
1617
all_users_configurations: dict[str, dict] = {}
1718

18-
config_data = {
19+
config_data: Dict[str, Any] = {
1920
# Telegram
2021
"BOT_TOKEN": "",
2122
"DELETE_MESSAGES": "",

handlers/patterns.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
from handlers.base_handler import PATTERN_URL_QUERY
2-
from typing import Dict, Optional
2+
from typing import Dict
33

4-
PATTERNS: Dict[str, Dict[str, Optional[str]]] = {
4+
from typing import TypedDict
5+
6+
class PatternConfig(TypedDict):
7+
pattern: str
8+
format_template: str
9+
affiliate_tag: str
10+
11+
PATTERNS: Dict[str, PatternConfig] = {
512
"amazon": {
613
"pattern": (
714
r"(https?://(?:www\.)?(?:amazon\.[a-z]{2,3}(?:\.[a-z]{2})?|amzn\.to|amzn\.eu)"

0 commit comments

Comments
 (0)