Home | History | Annotate | Download | only in common_lib

Lines Matching refs:namespace

182     as names. Additionally, the namespace 'stateful_property' is used for
239 for namespace, namespace_dict in on_disk_state.iteritems():
240 in_memory_namespace = self._state.setdefault(namespace, {})
246 'value', namespace, name, file_path)
250 'skipping import', namespace, name)
253 namespace, name, file_path)
324 def get(self, namespace, name, default=NO_DEFAULT):
327 @param namespace: The namespace that the property should be stored in.
338 if self.has(namespace, name):
339 return copy.deepcopy(self._state[namespace][name])
341 raise KeyError('No key %s in namespace %s' % (name, namespace))
347 def set(self, namespace, name, value):
350 @param namespace: The namespace that the property should be stored in.
354 namespace_dict = self._state.setdefault(namespace, {})
356 logging.debug('Persistent state %s.%s now set to %r', namespace,
361 def has(self, namespace, name):
362 """Return a boolean indicating if namespace.name is defined.
364 @param namespace: The namespace to check for a definition.
367 @return: True if the given name is defined in the given namespace and
370 return namespace in self._state and name in self._state[namespace]
374 def discard(self, namespace, name):
375 """If namespace.name is a defined value, deletes it.
377 @param namespace: The namespace that the property is stored in.
380 if self.has(namespace, name):
381 del self._state[namespace][name]
382 if len(self._state[namespace]) == 0:
383 del self._state[namespace]
384 logging.debug('Persistent state %s.%s deleted', namespace, name)
388 namespace, name)
392 def discard_namespace(self, namespace):
393 """Delete all defined namespace.* names.
395 @param namespace: The namespace to be cleared.
397 if namespace in self._state:
398 del self._state[namespace]
399 logging.debug('Persistent state %s.* deleted', namespace)
404 namespace='global_properties'):
414 @param namespace: The namespace to store the attribute value in.
421 return state.get(namespace, property_attribute, default)
424 state.set(namespace, property_attribute, value)