Skip to content

Instantly share code, notes, and snippets.

Last active January 24, 2017 01:58
What would you like to do?
xonsh migrate history items
from xonsh.history.json import JsonHistory
from xonsh.history.sqlite import SqliteHistory
hist_json = JsonHistory(gc=False)
# if you want to have a check first
print('have {} json items'.format(len(list(hist_json.all_items())))) # may very slow here
hist_db = SqliteHistory(gc=False)
for item in hist_json.all_items():
if 'inp' not in item:
if 'rtn' not in item:
item['rtn'] = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment