#!/usr/bin/env python

import gnucash
import sys
source_filename = sys.argv[1]
target_filename = source_filename+'-new'

gnucash.gnucash_core_c.gnc_set_account_separator(':')
read_session = gnucash.Session(source_filename, is_new=False)

read_root = read_session.book.get_root_account()
write_session = gnucash.Session(target_filename, is_new=True)
new_root = write_session.book.get_root_account()
write_session.end()
#read_session.end()

