Changeset 984
- Timestamp:
- Mar 29, 2012, 2:44:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dassmodus/trunk/dassmodus/nosferatu/nosferatu/tools/bacsource2configrules.py
r953 r984 163 163 164 164 def defvalue(type, name, value): 165 print "-> type=%s, name=%s, value=%s" % (type,name,value) 165 166 if type == 'store_opts': 166 167 if name in BOOL_FILESET_OPTIONS: … … 173 174 174 175 elif type == 'store_bool' or type == 'store_bit': 175 if value == 0 :176 if value == 0 or value == '0' or value == 'false' or value == None: 176 177 defval = False 177 178 else: … … 179 180 else: 180 181 defval = CONF2VALUE.get(value,value) 182 print "<- type=%s, name=%s, defaultvalue=%s" % (type,name,defval) 181 183 return defval 182 184 … … 227 229 pass 228 230 for i in keys: 229 231 #for i, v in conf[r].iteritems(): 230 232 name = i 231 233 v = conf[r][i] 232 type = v["handler"] 234 type = v["handler"] 233 235 required = v["flags"] == "ITEM_REQUIRED" 234 236 default = v["flags"] == "ITEM_DEFAULT" 235 237 defaultvalue = defvalue(type, name, v["default_value"]) 236 238 #defaultvalue = CONF2VALUE.get(v["default_value"],v["default_value"]) 237 if default: 239 if default: 238 240 value = defaultvalue 239 241 else: 240 242 value = defvalue(type, name, None) 243 print "name:%s value:%s defval: %s" % (name,value,defaultvalue) 241 244 s += " %s,\n" % repr(Item(name, value, defaultvalue, default, type, required)) 242 245 s += "]\n"
Note:
See TracChangeset
for help on using the changeset viewer.