Skip to content

Commit

Permalink
Add methods for getting unchanged history and log
Browse files Browse the repository at this point in the history
$%!% git patches disappearing
  • Loading branch information
hmpf committed Aug 22, 2023
1 parent 4e2570c commit 3a8b984
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/zinolib/ritz.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,36 +645,40 @@ def clean_attributes(self, caseinfo):

return cleaninfo

def get_history(self, caseid):
"""Return all history elements of a CaseID
Usage:
case_history = ritz_session.get_history(123)
"""
def get_raw_history(self, caseid):
# gethist Get Logs from CaseID
# Parameters: caseID
# Returns a list of historylines (timestamp, message)??
self.check_connection()
self.check_id(caseid, "CaseID")

response = self._request(b"gethist %d" % caseid)
return self._request(b"gethist %d" % caseid)

return _decode_history(response.data)

def get_log(self, caseid):
"""Return all log elements of a CaseID
def get_history(self, caseid):
"""Return all history elements of a CaseID
Usage:
case_logs = ritz_session.get_log(123)
case_history = ritz_session.get_history(123)
"""
response = self.get_raw_history(caseid)
return _decode_history(response.data)

def get_raw_log(self, caseid):
# getlog Get Logs from CaseID
# Parameters: caseID
# Returns a list of loglines (timestamp, message)
self.check_connection()
self.check_id(caseid, "CaseID")

response = self._request(b"getlog %d" % caseid)
return self._request(b"getlog %d" % caseid)

def get_log(self, caseid):
"""Return all log elements of a CaseID
Usage:
case_logs = ritz_session.get_log(123)
"""
response = self.get_raw_log(caseid)
return _decode_history(response.data)

def add_history(self, caseid, message):
Expand Down

0 comments on commit 3a8b984

Please sign in to comment.