mirror of
https://github.com/ai-robots-txt/ai.robots.txt.git
synced 2026-07-16 19:34:31 +02:00
robots.py: pass everything to consolodate
This commit is contained in:
parent
7dbe93295e
commit
80357baf9c
1 changed files with 6 additions and 5 deletions
|
|
@ -34,7 +34,7 @@ default_values = {
|
|||
}
|
||||
default_value = "Unclear at this time."
|
||||
|
||||
def consolidate(field: str, value: str) -> str:
|
||||
def consolidate(existing_content, name: str, field: str, value: str) -> str:
|
||||
# New entry
|
||||
if name not in existing_content:
|
||||
return value
|
||||
|
|
@ -93,11 +93,12 @@ def updated_robots_json(soup):
|
|||
print(f"Error: {e}")
|
||||
|
||||
existing_content[name] = {
|
||||
"operator": consolidate("operator", operator),
|
||||
"respect": consolidate("respect", default_value),
|
||||
"function": consolidate("function", f"{category}"),
|
||||
"frequency": consolidate("frequency", default_value),
|
||||
"operator": consolidate(existing_content, name, "operator", operator),
|
||||
"respect": consolidate(existing_content, name, "respect", default_value),
|
||||
"function": consolidate(existing_content, name, "function", f"{category}"),
|
||||
"frequency": consolidate(existing_content, name, "frequency", default_value),
|
||||
"description": consolidate(
|
||||
existing_content, name,
|
||||
"description",
|
||||
"{desc} More info can be found at https://darkvisitors.com{path}".format(
|
||||
desc = desc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue