예제 #1
0
파일: sets.py 프로젝트: bashwork/common
    def add(self, value, time=None):
        ''' Add the value to the set.

        :param value: The value to add to the set
        :param time: The time to add this value at
        '''
        time = time or current_time()
        self.pdata[value] = time
예제 #2
0
파일: register.py 프로젝트: bashwork/common
    def set(self, value, time=None):
        ''' Given a new value, attempt to set it in the register

        :param value: The new value to set
        :param time: The new time to compare with
        '''
        self.time = time or current_time()
        self.data = value
예제 #3
0
파일: sets.py 프로젝트: bashwork/common
    def remove(self, value, time=None):
        ''' Remove the value from the set.

        :param value: The value to remove from the set
        :param time: The time to remove this value at
        '''
        assert value in self.pdata, "cannot remove a value that is not present"
        time = time or current_time()
        self.ndata[value] = time