devtools/__init__.py
changeset 10510 51321946da37
parent 10474 1dcc52f5e340
child 10568 3914388b2d0f
child 10644 c43e5dc41f8b
equal deleted inserted replaced
10509:e8ac062d4b20 10510:51321946da37
   781     def _backup_database(self, db_id=DEFAULT_EMPTY_DB_ID):
   781     def _backup_database(self, db_id=DEFAULT_EMPTY_DB_ID):
   782         # XXX remove database file if it exists ???
   782         # XXX remove database file if it exists ???
   783         dbfile = self.absolute_dbfile()
   783         dbfile = self.absolute_dbfile()
   784         backup_file = self.absolute_backup_file(db_id, 'sqlite')
   784         backup_file = self.absolute_backup_file(db_id, 'sqlite')
   785         shutil.copy(dbfile, backup_file)
   785         shutil.copy(dbfile, backup_file)
   786         # Usefull to debug WHO write a database
   786         # Useful to debug WHO writes a database
   787         # backup_stack = self.absolute_backup_file(db_id, '.stack')
   787         # backup_stack = self.absolute_backup_file(db_id, '.stack')
   788         #with open(backup_stack, 'w') as backup_stack_file:
   788         #with open(backup_stack, 'w') as backup_stack_file:
   789         #    import traceback
   789         #    import traceback
   790         #    traceback.print_stack(file=backup_stack_file)
   790         #    traceback.print_stack(file=backup_stack_file)
   791         return backup_file
   791         return backup_file