Ticket #4374: management.diff
File management.diff, 951 bytes (added by , 17 years ago) |
---|
-
management.py
old new 379 379 for sql_file in sql_files: 380 380 if os.path.exists(sql_file): 381 381 fp = open(sql_file, 'U') 382 trigger = False 382 383 for statement in statements.split(fp.read()): 383 384 # Remove any comments from the file 384 385 statement = re.sub(r"--.*[\n\Z]", "", statement) 385 386 if statement.strip(): 386 output.append(statement + ";") 387 if trigger: 388 output[-1] = output[-1] + statement + ";" 389 if 'end' in statement.lower(): 390 trigger = False 391 else: 392 output.append(statement + ";") 393 if 'create trigger' in statement.lower(): 394 trigger = True 387 395 fp.close() 388 396 389 397 return output