@Session
    @UserUpdate
    def update_session(self, updateLog):
        user = self.pb['router'].getUser(self.sessionContext['uid'])
        # user object must be allways found through the above iteration since it is secured by
        # the @UserExist annotation on update() method

        for key, value in updateLog.iteritems():
            if key[:1] == '_':
                # When key is prefixed by '_' it must be treated exceptionnally since the value
                # is holding advanced update log of a sub-User object
                subUserObject = getattr(user, key[1:])
                for update in value.iteritems():
                    section = update[0]
                    if update[1] is None:
                        continue

                    for SectionKey, SectionValue in update[1].iteritems():
                        if str(SectionValue)[:1] in ['+', '-']:
                            if str(SectionValue)[:1] == '+':
                                # Decode the value and its type
                                if str(SectionValue)[1:2] == 'f':
                                    getattr(subUserObject, 'update%s' % section)(
                                        SectionKey, float(SectionValue[2:]))
                                elif str(SectionValue)[1:2] == 'i':
                                    getattr(subUserObject, 'update%s' % section)(
                                        SectionKey, int(SectionValue[2:]))
                            else:
                                getattr(subUserObject, 'update%s' % section)(SectionKey, SectionValue)
                        else:
                            try:
                                getattr(subUserObject, 'set%s' % section)(SectionKey, SectionValue)
                            except jasminApiCredentialError:
                                self.protocol.sendData(
                                    SectionKey % '%s not supported in this object, ignoring its value.',
                                    prompt=False)
            else:
                if key == 'password':
                    setattr(user, key, md5(value).digest())
                else:
                    setattr(user, key, value)

        self.protocol.sendData('Successfully updated User [%s]' % self.sessionContext['uid'], prompt=False)
        self.stopSession()
dataset/ETHPy150Open jookies/jasmin/jasmin/protocols/cli/usersm.py/UsersManager.update_session/swapped operands of `%`