def _pushpages(pages): tdb.transact() try: for p in pages.values(): print('saving', p.name) _savepage(p) except: tdb.rollback() raise else: tdb.commit()
def _pushpages(pages): tdb.transact() try: for p in pages.values(): print 'saving', p.name _savepage(p) except: tdb.rollback() raise else: tdb.commit()
def dataload(filename): """Loads data dumped using datadump action into the database.""" lines = open(filename).xreadlines() tdb.transact() try: for line in lines: data = storify(eval(line)) _savepage(data) except: tdb.rollback() raise else: tdb.commit()
def dataload(filename): """"Loads data dumped using datadump action into the database.""" lines = open(filename).xreadlines() tdb.transact() try: for line in lines: data = storify(eval(line)) _savepage(data) except: tdb.rollback() raise else: tdb.commit()
def apply_upgrades(): from infogami import tdb tdb.transact() try: v = get_db_version() for u in upgrades[v:]: print >> web.debug, 'applying upgrade:', u.__name__ u() mark_upgrades() tdb.commit() print >> web.debug, 'upgrade successful.' except: print >> web.debug, 'upgrade failed' import traceback traceback.print_exc() tdb.rollback()