File indexing completed on 2026-04-10 08:39:01
0001 """
0002 Class to represent the result of the Adder operation
0003
0004 """
0005
0006 class AdderResult:
0007 """
0008 Class to represent the result of the Adder operation.
0009 """
0010
0011 __slot__ = ("statusCode", "transferringFiles")
0012
0013
0014 rc_succeeded = 0
0015 rc_temporary = 1
0016 rc_fatal = 2
0017
0018
0019 def __init__(self) -> None:
0020 """
0021 Initialize the AdderResult with default values.
0022 """
0023
0024 self.status_code = None
0025
0026
0027 self.transferring_files = []
0028
0029
0030 self.merging_files = []
0031
0032
0033 def set_succeeded(self):
0034 """
0035 Set the status to succeeded.
0036 """
0037 self.status_code = self.rc_succeeded
0038
0039
0040 def set_temporary(self):
0041 """
0042 Set the status to temporary error.
0043 """
0044 self.status_code = self.rc_temporary
0045
0046
0047 def set_fatal(self):
0048 """
0049 Set the status to fatal.
0050 """
0051 self.status_code = self.rc_fatal
0052
0053
0054 def is_succeeded(self):
0055 """
0056 Check if the status is 'succeeded'.
0057 True if status is 'succeeded', False otherwise.
0058 """
0059 return self.status_code == self.rc_succeeded
0060
0061
0062 def is_temporary(self):
0063 """
0064 Check if the status is 'temporary'.
0065 True if status is 'temporary', False otherwise.
0066 """
0067 return self.status_code == self.rc_temporary
0068
0069
0070 def is_fatal(self):
0071 """
0072 Check if the status is 'fatal'.
0073 True if status is 'fatal', False otherwise.
0074 """
0075 return self.status_code == self.rc_fatal