Changeset 5628
- Timestamp:
- Aug 8, 2008, 9:28:34 AM (15 years ago)
- Location:
- anuga_core/source/anuga
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/urs_ext.c
r5612 r5628 2 2 gcc -fPIC -c urs_ext.c -I/usr/include/python2.5 -o urs_ext.o -Wall -O 3 3 gcc -shared urs_ext.o -o urs_ext.so 4 */5 6 /*7 This file was reverted from changeset:5484 to changeset:5470 on 10th July8 by Ole.9 4 */ 10 5 … … 30 25 31 26 static long numDataMax=0; 27 28 29 /*The MUX file format 30 31 32 */ 33 34 32 35 33 36 ///////////////////////////////////////////////////////////////////////// … … 294 297 } 295 298 299 296 300 // Store time resolution and number of timesteps 297 301 // These are the same for all stations as tested above, so … … 394 398 muxData = (float*) malloc(numDataMax*sizeof(float)); 395 399 396 / * Loop over all sources */400 // Loop over all sources 397 401 for (isrc = 0; isrc < numSrc; isrc++) 398 402 { … … 437 441 total_number_of_stations, 438 442 number_of_time_steps, 439 mytgs0[ista].ig, 443 mytgs0[ista].ig, // Grid number (if -1 fill with zeros) 440 444 fros_per_source, 441 445 lros_per_source, -
anuga_core/source/anuga/utilities/data_audit.py
r5195 r5628 257 257 """ 258 258 259 if verbose: 260 print 'Parsing', license_filename 261 259 262 doc = xml2object(license_filename) 260 263 -
anuga_core/source/anuga/utilities/xml_tools.py
r5162 r5628 239 239 fid = xml 240 240 241 dom = parse(fid) 242 243 ## try: 244 ## dom = parse(fid) 245 ## except Exception, e: 246 ## # Throw filename into dom exception 247 ## msg = 'XML file "%s" could not be parsed: ' %fid.name 248 ## msg += str(e) 249 ## raise Exception, msg 250 251 return dom2object(dom) 241 try: 242 dom = parse(fid) 243 except Exception, e: 244 # Throw filename into dom exception 245 msg = 'XML file "%s" could not be parsed.\n' %fid.name 246 msg += 'Error message from parser: "%s"' %str(e) 247 raise Exception, msg 248 249 try: 250 xml_object = dom2object(dom) 251 except Exception, e: 252 msg = 'Could not convert %s into XML object.\n' %fid.name 253 msg += str(e) 254 raise Exception, msg 255 256 return xml_object 252 257 253 258 … … 258 263 259 264 value = [] 265 textnode_encountered = None 260 266 for n in node.childNodes: 261 267 262 268 if n.nodeType == 3: 263 269 # Child is a text element - omit the dom tag #text and 264 270 # go straight to the text value. 265 271 272 # Note - only the last text value will be recorded 273 266 274 msg = 'Text element has child nodes - this shouldn\'t happen' 267 275 assert len(n.childNodes) == 0, msg … … 273 281 continue 274 282 275 value = x283 textnode_encountered = value = x 276 284 else: 277 285 # XML element 286 287 288 if textnode_encountered is not None: 289 msg = 'A text node was followed by a non-text tag. This is not allowed.\n' 290 msg += 'Offending text node: "%s" ' %str(textnode_encountered) 291 msg += 'was followed by node named: "<%s>"' %str(n.nodeName) 292 raise Exception, msg 293 278 294 279 295 value.append(dom2object(n))
Note: See TracChangeset
for help on using the changeset viewer.