Changeset 1834 for trunk/python
- Timestamp:
- 08/03/10 15:07:58 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/parameters.py
r1824 r1834 155 155 def rc_params(): 156 156 'Return the default params updated from the values in the rc file' 157 from asap.logging import asaplog, print_log158 157 fname = _asap_fname() 159 158 160 159 if fname is None or not os.path.exists(fname): 161 message = 'could not find rc file; returning defaults'162 160 ret = dict([ (key, tup[0]) for key, tup in defaultParams.items()]) 163 161 #print message 162 #message = 'could not find rc file; returning defaults' 164 163 return ret 165 164 … … 172 171 tup = line.split(':',1) 173 172 if len(tup) !=2: 174 #print ('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname))175 asaplog.push('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname))176 print_log('WARN')173 print ('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname)) 174 #asaplog.push('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname)) 175 #print_log('WARN') 177 176 continue 178 177 … … 180 179 key = key.strip() 181 180 if not defaultParams.has_key(key): 182 #print ('Bad key "%s" on line %d in %s' % (key, cnt, fname))183 asaplog.push('Bad key "%s" on line %d in %s' % (key, cnt, fname))184 print_log('WARN')181 print ('Bad key "%s" on line %d in %s' % (key, cnt, fname)) 182 #asaplog.push('Bad key "%s" on line %d in %s' % (key, cnt, fname)) 183 #print_log('WARN') 185 184 continue 186 185 … … 192 191 try: cval = converter(val) # try to convert to proper type or raise 193 192 except ValueError, msg: 194 #print ('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, msg))195 asaplog.push('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, str(msg)))196 print_log('WARN')193 print ('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, msg)) 194 #asaplog.push('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, str(msg))) 195 #print_log('WARN') 197 196 continue 198 197 else:
Note:
See TracChangeset
for help on using the changeset viewer.