summaryrefslogtreecommitdiffstats
path: root/flags.py
blob: b2ef58f700e9adbd2443f83441f14243de874476 (plain)
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
# A lot of effort, but it only allows a limited set of flags to be referenced
class Flags:

    def __getattr__(self, attr):
	if self.__dict__['flags'].has_key(attr):
	    return self.__dict__['flags'][attr]

	raise AttributeError, attr

    def __setattr__(self, attr, val):
	if self.__dict__['flags'].has_key(attr):
	    self.__dict__['flags'][attr] = val
	else:
	    raise AttributeError, attr
	
    def __init__(self):
	self.__dict__['flags'] = {}
	self.__dict__['flags']['test'] = 0
	self.__dict__['flags']['expert'] = 0
	self.__dict__['flags']['serial'] = 0
	self.__dict__['flags']['setupFilesystems'] = 1


global flags
flags = Flags()