Skip to content

Commit e67d89f

Browse files
authored
Merge pull request #3 from nibrahim/style_fixes
Removes unnecessary decoration in commits
2 parents 938dcac + ab692ea commit e67d89f

File tree

1 file changed

+10
-36
lines changed

1 file changed

+10
-36
lines changed

update_domains.py

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
CONFIG_FILE = "conf/conf.yaml"
2323

2424

25-
# ==============================================================================
26-
# Utility Functions
27-
# ==============================================================================
25+
## Utility Functions
2826

2927
def fetch_url(url: str) -> bytes:
3028
"""Fetch content from a URL."""
@@ -96,10 +94,7 @@ def find_domains_section_end(lines: list, start_idx: int) -> int:
9694

9795
return len(lines)
9896

99-
100-
# ==============================================================================
101-
# Source-Specific Functions: Bon Appetit Porn Domains
102-
# ==============================================================================
97+
## Source-Specific Functions: Bon Appetit Porn Domains
10398

10499
def fetch_bon_appetit() -> Tuple[List[str], str, Dict]:
105100
"""
@@ -166,9 +161,7 @@ def parse_bon_appetit(domain: str) -> str:
166161
return f' - {{"name": "{domain}", "always_block": true, "absolute": true}}'
167162

168163

169-
# ==============================================================================
170-
# Source-Specific Functions: StevenBlack Hosts
171-
# ==============================================================================
164+
## Source-Specific Functions: StevenBlack Hosts
172165

173166
def fetch_stevenblack() -> Tuple[List[str], str, Dict]:
174167
"""
@@ -244,9 +237,7 @@ def parse_stevenblack(domain: str) -> str:
244237
return f' - {{\"name\": \"{domain}\", \"always_block\": true, \"absolute\": true}}'
245238

246239

247-
# ==============================================================================
248-
# Source-Specific Functions: HaGeZi DoH/VPN/TOR/Proxy Bypass
249-
# ==============================================================================
240+
## Source-Specific Functions: HaGeZi DoH/VPN/TOR/Proxy Bypass
250241

251242
def fetch_hagezi() -> Tuple[List[str], str, Dict]:
252243
"""
@@ -324,9 +315,7 @@ def parse_hagezi(domain: str) -> str:
324315
return f' - {{\"name\": \"{domain}\", \"always_block\": true, \"absolute\": true}}'
325316

326317

327-
# ==============================================================================
328-
# Source-Specific Functions: UnblockStop Proxy Bypass
329-
# ==============================================================================
318+
## Source-Specific Functions: UnblockStop Proxy Bypass
330319

331320
def fetch_unblockstop() -> Tuple[List[str], str, Dict]:
332321
"""
@@ -390,10 +379,7 @@ def parse_unblockstop(domain: str) -> str:
390379
return f' - {{\"name\": \"{domain}\", \"always_block\": true, \"absolute\": true}}'
391380

392381

393-
# ==============================================================================
394-
# Source Registry
395-
# ==============================================================================
396-
382+
## Source Registry
397383
SOURCES = [
398384
{
399385
'id': 1,
@@ -431,9 +417,7 @@ def parse_unblockstop(domain: str) -> str:
431417
]
432418

433419

434-
# ==============================================================================
435-
# Generic Source Update Logic
436-
# ==============================================================================
420+
## Generic Source Update Logic
437421

438422
def get_source_by_id(source_id: int) -> Optional[Dict]:
439423
"""Get source definition by ID."""
@@ -590,10 +574,7 @@ def update_source(source_id: int):
590574
print(f" Error writing config file: {e}", file=sys.stderr)
591575
sys.exit(1)
592576

593-
594-
# ==============================================================================
595-
# Strip Managed Sources
596-
# ==============================================================================
577+
## Strip Managed Sources
597578

598579
def strip_managed_sources():
599580
"""Remove all managed domain lists from the config file."""
@@ -659,11 +640,7 @@ def strip_managed_sources():
659640
print(f" Error writing config file: {e}", file=sys.stderr)
660641
sys.exit(1)
661642

662-
663-
# ==============================================================================
664-
# Source Listing
665-
# ==============================================================================
666-
643+
## Source Listing
667644
def list_sources():
668645
"""Display all available sources with their current status."""
669646
# Read config file once
@@ -713,10 +690,7 @@ def list_sources():
713690
print(" ./update_domains.py <number> - Update a specific source")
714691
print(" ./update_domains.py strip - Remove all managed sources\n")
715692

716-
717-
# ==============================================================================
718-
# Main Entry Point
719-
# ==============================================================================
693+
## Main Entry Point
720694

721695
def main():
722696
"""Main execution function with CLI argument parsing."""

0 commit comments

Comments
 (0)