1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-24 15:18:54 +02:00

add option for deleterequests using auto-accept

This commit is contained in:
2013-12-05 10:23:53 +01:00
parent 359d5c5a84
commit f202fbd111
3 changed files with 15 additions and 0 deletions

View File

@@ -2480,6 +2480,8 @@ class Request:
ET.SubElement(root, 'title').text = self.title
if self.description:
ET.SubElement(root, 'description').text = self.description
if self.accept_at:
ET.SubElement(root, 'accept_at').text = self.accept_at
return root
def to_str(self):
@@ -2488,6 +2490,14 @@ class Request:
xmlindent(root)
return ET.tostring(root, encoding=ET_ENCODING)
def accept_at_in_hours(self, hours):
"""set auto accept_at time"""
import datetime
now = datetime.datetime.utcnow()
now = now + datetime.timedelta(hours=hours)
self.accept_at = now.isoformat()
@staticmethod
def format_review(review, show_srcupdate=False):
"""