def update(self, units: int=<NUM_LIT:1>, message: str=None):
if self.total is None:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>self.worked = min(self.total, self.worked+units)<EOL>if message:<EOL><INDENT>self.message = message<EOL><DEDENT>for listener in self.listeners:<EOL><INDENT>listener(self)<EOL><DEDENT>
Increment the monitor with N units worked and an optional message