(self, merge_state)
return state
Read state from string.
Read state from string.
Read state from string .
def parse_state(self, merge_state):
        """Read state from string."""

        state = -1
        if merge_state == None:
            state = TABLE_MISSING
        elif merge_state == "in-copy":
            state = TABLE_IN_COPY
        elif merge_state == "catching-up":
            state = TABLE_CATCHING_UP
        elif merge_state == "ok":
            state = TABLE_OK
        elif merge_state == "?":
            state = TABLE_OK
        else:
            tmp = merge_state.split(':')
            if len(tmp) == 2:
                self.sync_tick_id = int(tmp[1])
                if tmp[0] == 'wanna-sync':
                    state = TABLE_WANNA_SYNC
                elif tmp[0] == 'do-sync':
                    state = TABLE_DO_SYNC

        if state < 0:
            raise Exception("Bad table state: %s" % merge_state)

        return state
def parse_state ( self , merge_state ) : state = - 1 if merge_state == None : state = TABLE_MISSING elif merge_state == "in-copy" : state = TABLE_IN_COPY elif merge_state == "catching-up" : state = TABLE_CATCHING_UP elif merge_state == "ok" : state = TABLE_OK elif merge_state == "?" : state = TABLE_OK else : tmp = merge_state . split ( ':' ) if len ( tmp ) == 2 : self . sync_tick_id = int ( tmp [ 1 ] ) if tmp [ 0 ] == 'wanna-sync' : state = TABLE_WANNA_SYNC elif tmp [ 0 ] == 'do-sync' : state = TABLE_DO_SYNC if state < 0 : raise Exception ( "Bad table state: %s" % merge_state ) return state