osclib/comments: provide request description as comment.
Useful for operating on request descriptions inline with comments.
This commit is contained in:
parent
75836fec70
commit
7559153cbf
@ -1,4 +1,5 @@
|
||||
from datetime import datetime
|
||||
from dateutil.parser import parse as date_parse
|
||||
import re
|
||||
from xml.etree import cElementTree as ET
|
||||
|
||||
@ -49,6 +50,15 @@ class CommentAPI(object):
|
||||
}
|
||||
return comment
|
||||
|
||||
def request_as_comment_dict(self, request):
|
||||
return {
|
||||
'who': request.creator,
|
||||
'when': date_parse(request.statehistory[0].when),
|
||||
'id': '-1',
|
||||
'parent': None,
|
||||
'comment': request.description,
|
||||
}
|
||||
|
||||
def get_comments(self, request_id=None, project_name=None,
|
||||
package_name=None):
|
||||
"""Get the list of comments of an object in OBS.
|
||||
|
Loading…
x
Reference in New Issue
Block a user