Browse Source

Hopefully, smarter handling of closed/resolved cases.

tags/v0.1^2
Ben Kurtovic 12 years ago
parent
commit
70c284bca9
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      earwigbot/tasks/drn_clerkbot.py

+ 7
- 3
earwigbot/tasks/drn_clerkbot.py View File

@@ -326,10 +326,14 @@ class DRNClerkBot(Task):
close_age = (datetime.utcnow() - case.close_time).total_seconds()
modify_age = (datetime.utcnow() - max(timestamps)).total_seconds()
if closed_age > 60 * 60 * 24 and modify_age > 60 * 60 * 24:
arch_top = self.tl_archive_top
arch_bottom = self.tl_archive_bottom
reg = "<!-- \[\[User:DoNotArchiveUntil\]\] .*? -->(<!-- .*? -->)?"
repl = "{{" + self.tl_archive_top + "}}"
case.body = re.sub(reg, repl, case.body)
case.body += "\n{{" + self.tl_archive_bottom + "}}"
if re.search(reg, case.body):
case.body = re.sub("\{\{" + arch_top + "\}\}", "", case.body)
case.body = re.sub(reg, "{{" + arch_top + "}}", case.body)
if not re.search(arch_bottom + "\s*\}\}\s*\Z", case.body):
case.body += "\n{{" + arch_bottom + "}}"
case.status = self.STATUS_UNKNOWN

def check_for_review(self, case):


Loading…
Cancel
Save