From 3a8b984fc681ef21c7f634095bfc8df064d6a41b Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Thu, 22 Jun 2023 09:57:06 +0200 Subject: [PATCH] Add methods for getting unchanged history and log $%!% git patches disappearing --- src/zinolib/ritz.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/zinolib/ritz.py b/src/zinolib/ritz.py index fec7d33..e5a71cf 100644 --- a/src/zinolib/ritz.py +++ b/src/zinolib/ritz.py @@ -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):