Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
lvlvllvlvllvlvl committed Dec 15, 2023
1 parent f63c0ca commit b102848
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions PyPoE/cli/exporter/wiki/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

# Python
from difflib import unified_diff
from itertools import islice
from queue import Empty, SimpleQueue
from threading import Lock

Expand Down Expand Up @@ -229,12 +230,15 @@ def handle_page(self, *a, row=None, rownum=None):
if ("[DNT]" in text or "[UNUSED]" in text) and new:
console("Found text marked as Do Not Translate. Skipping.")
return
revisions = page.exists and [
r["content"].splitlines()
for r in page.revisions(limit=2, prop="content|comment")
if not r["comment"].startswith("PyPoE/ExporterBot/")
]
if revisions and new_lines in revisions:
rev1, rev2 = (
islice(page.revisions(limit=2, prop="content|comment"), 2)
if page.exists
else [None, None]
)
previous_revision = (
page.exists and not rev1["comment"].startswith("PyPoE/ExporterBot/") and rev2["*"]
)
if previous_revision == new_lines:
console(
f"Update to {pdata['page']} would be a manual revert, skipping this row.",
msg=Msg.warning,
Expand Down

0 comments on commit b102848

Please sign in to comment.