/usr/share/pyshared/freshen/context.py is in python-freshen 0.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #-*- coding: utf8 -*-
__all__ = ['glc', 'ftc', 'scc']
# Contexts
class Context(object):
"""
A javascript/lua like dictionary whose items can be accessed as attributes
"""
def __init__(self):
self.__dict__['d'] = {}
def __getattr__(self, name):
if name in self.d:
return self.d[name]
else:
return None
__getitem__ = __getattr__
def __setattr__(self, name, value):
self.d[name] = value
__setitem__ = __setattr__
def __delattr__(self, name):
if name in self.d:
del self.d[name]
__delitem__ = __delattr__
def clear(self):
self.__dict__['d'] = {}
glc = Context() # Global context - never cleared
ftc = Context() # Feature context - cleared for every feature
scc = Context() # Scenario context - cleared for every scenario
|