/usr/lib/imh-ultrastack-common/venv/lib/python3.13/site-packages/supervisor/medusa
NameSizeModeActions
__pycache__/-0755rm
asynchat_25.py108280644editdlrm
asyncore_25.py170900644editdlrm
auth_handler.py49900644editdlrm
counter.py15080644editdlrm
default_handler.py63550644editdlrm
filesys.py113680644editdlrm
http_date.py32230644editdlrm
http_server.py295550644editdlrm
logger.py70750644editdlrm
producers.py89930644editdlrm
util.py13540644editdlrm
xmlrpc_handler.py31350644editdlrm
__init__.py1210644editdlrm
Edit: /usr/lib/imh-ultrastack-common/venv/lib/python3.13/site-packages/supervisor/medusa/counter.py (1508B)
# -*- Mode: Python -*- # It is tempting to add an __int__ method to this class, but it's not # a good idea. This class tries to gracefully handle integer # overflow, and to hide this detail from both the programmer and the # user. Note that the __str__ method can be relied on for printing out # the value of a counter: # # >>> print 'Total Client: %s' % self.total_clients # # If you need to do arithmetic with the value, then use the 'as_long' # method, the use of long arithmetic is a reminder that the counter # will overflow. from supervisor.compat import long class counter: """general-purpose counter""" def __init__ (self, initial_value=0): self.value = initial_value def increment (self, delta=1): result = self.value try: self.value = self.value + delta except OverflowError: self.value = long(self.value) + delta return result def decrement (self, delta=1): result = self.value try: self.value = self.value - delta except OverflowError: self.value = long(self.value) - delta return result def as_long (self): return long(self.value) def __nonzero__ (self): return self.value != 0 __bool__ = __nonzero__ def __repr__ (self): return '' % (self.value, id(self)) def __str__ (self): s = str(long(self.value)) if s[-1:] == 'L': s = s[:-1] return s