Exemplo n.º 1
0
 def insert(self, key, newkey, newvalue, order):
     index = self._key_list.index(key)
     if order == 'BEFORE':
         self._key_list.insert(index, newkey)
         IterableUserDict.__setitem__(self, newkey, newvalue)
     elif order == 'AFTER':
         self._key_list.insert(index + 1, newkey)
         IterableUserDict.__setitem__(self, newkey, newvalue)
Exemplo n.º 2
0
 def __setitem__ (self, i, y):
     """W.__setitem__ (i, y) <==> w[i] = y
     """
     IterableUserDict.__setitem__ (self, i, y)
     if isinstance (y, WidgetStyle):
         y.set_value_changed (self._valuechanged)
     if self._valuechanged:
         self._valuechanged ()
Exemplo n.º 3
0
 def insert(self, Key, Newkey, Newvalue, Order):
     Index = self._key_list.index(Key)
     if Order == 'BEFORE':
         self._key_list.insert(Index, Newkey)
         IterableUserDict.__setitem__(self, Newkey, Newvalue)
     elif Order == 'AFTER':
         self._key_list.insert(Index + 1, Newkey)
         IterableUserDict.__setitem__(self, Newkey, Newvalue)
Exemplo n.º 4
0
 def insert(self, Key, Newkey, Newvalue, Order):
     Index = self._key_list.index(Key)
     if Order == 'BEFORE':
         self._key_list.insert(Index, Newkey)
         IterableUserDict.__setitem__(self, Newkey, Newvalue)
     elif Order == 'AFTER':
         self._key_list.insert(Index + 1, Newkey)
         IterableUserDict.__setitem__(self, Newkey, Newvalue)
Exemplo n.º 5
0
    def __setitem__(self, pkg_id, session_data):
        """Set an `zope.session.interfaces.ISessionData`

            >>> sdc = PersistentSessionDataContainer()
            >>> sad = SessionData()

        ``__setitem__`` sets the ``ISessionData``'s ``lastAccessTime``

            >>> sad.getLastAccessTime()
            0
            >>> sdc['1'] = sad
            >>> 0 < sad.getLastAccessTime() <= time.time()
            True

        We can retrieve the same object we put in

            >>> sdc['1'] is sad
            True

        """
        session_data.setLastAccessTime(int(time.time()))
        return UserDict.__setitem__(self, pkg_id, session_data)
Exemplo n.º 6
0
    def __setitem__(self, pkg_id, session_data):
        """Set an ISessionPkgData

            >>> sdc = PersistentSessionDataContainer()
            >>> sad = SessionData()

        __setitem__ sets the ISessionData's lastAccessTime

            >>> sad.lastAccessTime
            0
            >>> sdc['1'] = sad
            >>> 0 < sad.lastAccessTime <= time.time()
            True

        We can retrieve the same object we put in

            >>> sdc['1'] is sad
            True

        """
        session_data.lastAccessTime = int(time.time())
        return IterableUserDict.__setitem__(self, pkg_id, session_data)
Exemplo n.º 7
0
 def append(self, Sdict2):
     for Key in Sdict2:
         if Key not in self._key_list:
             self._key_list.append(Key)
         IterableUserDict.__setitem__(self, Key, Sdict2[Key])
Exemplo n.º 8
0
 def __setitem__(self, key, item):
     IterableUserDict.__setitem__(self, key, item)
     if key not in self._keys:
         self._keys.append(key)
Exemplo n.º 9
0
 def __setitem__(self, Key, Value):
     if Key not in self._key_list:
         self._key_list.append(Key)
     IterableUserDict.__setitem__(self, Key, Value)
Exemplo n.º 10
0
 def __setitem__(self, key, value):
     "Creates a tuple consisting of the current time stamp and the value and stores that tuple under the key."
     data = {"time": time.time(), "value": value}
     return IterableUserDict.__setitem__(self, key, data)
Exemplo n.º 11
0
 def __setitem__(self, key, value):
     IterableUserDict.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
Exemplo n.º 12
0
 def __setitem__(self, key, item):
     IterableUserDict.__setitem__(self, key, item)
     if key not in self._keys: self._keys.append(key)
Exemplo n.º 13
0
 def append(self, Sdict2):
     for Key in Sdict2:
         if Key not in self._key_list:
             self._key_list.append(Key)
         IterableUserDict.__setitem__(self, Key, Sdict2[Key])
Exemplo n.º 14
0
	def __setitem__(self, key, value):
		IterableUserDict.__setitem__(self, PBXType.Convert(key), PBXType.Convert(value))
Exemplo n.º 15
0
 def __setitem__(self, key, value):
     IterableUserDict.__setitem__(self, key, value)
     self.flush()
Exemplo n.º 16
0
 def __setitem__(self, Key, Value):
     if Key not in self._key_list:
         self._key_list.append(Key)
     IterableUserDict.__setitem__(self, Key, Value)
Exemplo n.º 17
0
 def append(self, sdict):
     for key in sdict:
         if key not in self._key_list:
             self._key_list.append(key)
         IterableUserDict.__setitem__(self, key, sdict[key])
Exemplo n.º 18
0
 def insert(self, index, key, value):
     IterableUserDict.__setitem__(self, key, value)
     self._keys.insert(index, key)
Exemplo n.º 19
0
 def __setitem__(self, key, value):
     if key not in self._key_list:
         self._key_list.append(key)
     IterableUserDict.__setitem__(self, key, value)