comparison bitten/upgrades.py @ 861:a08acf72a846 0.6.x

0.6dev: Merged [r938] from trunk.
author hodgestar
date Sun, 17 Oct 2010 23:24:07 +0000
parents 3d4f61044b42
children 467e993df52d
comparison
equal deleted inserted replaced
856:3ee5abad55ea 861:a08acf72a846
430 def migrate_logs_to_files(env, db): 430 def migrate_logs_to_files(env, db):
431 """Migrates logs that are stored in the bitten_log_messages table into files.""" 431 """Migrates logs that are stored in the bitten_log_messages table into files."""
432 logs_dir = env.config.get("bitten", "logs_dir", "log/bitten") 432 logs_dir = env.config.get("bitten", "logs_dir", "log/bitten")
433 if not os.path.isabs(logs_dir): 433 if not os.path.isabs(logs_dir):
434 logs_dir = os.path.join(env.path, logs_dir) 434 logs_dir = os.path.join(env.path, logs_dir)
435 if not os.path.exists(logs_dir): 435
436 os.makedirs(logs_dir) 436 if os.path.exists(logs_dir):
437 print "Bitten log folder %r already exists" % (logs_dir,)
438 print "Upgrade cannot be performed until the existing folder is moved."
439 print "The upgrade script will now exit with an error:\n"
440 raise TracError("")
441
442 os.makedirs(logs_dir)
437 443
438 cursor = db.cursor() 444 cursor = db.cursor()
439 message_cursor = db.cursor() 445 message_cursor = db.cursor()
440 update_cursor = db.cursor() 446 update_cursor = db.cursor()
441 cursor.execute("SELECT id FROM bitten_log") 447 cursor.execute("SELECT id FROM bitten_log")
Copyright (C) 2012-2017 Edgewall Software