|
a/scripts/restore_project.py |
|
b/scripts/restore_project.py |
|
... |
|
... |
39 |
with open(os.path.join(dirname, 'project.json')) as fp:
|
39 |
with open(os.path.join(dirname, 'project.json')) as fp:
|
40 |
project_doc = json.load(fp, object_hook=object_hook)
|
40 |
project_doc = json.load(fp, object_hook=object_hook)
|
41 |
st = state(project)
|
41 |
st = state(project)
|
42 |
st.document = instrument(project_doc, DocumentTracker(st))
|
42 |
st.document = instrument(project_doc, DocumentTracker(st))
|
43 |
project.shortname = new_shortname
|
43 |
project.shortname = new_shortname
|
44 |
project.set_tool_data('sfx', 'unix_group_name', new_unix_group_name)
|
44 |
project.set_tool_data('sfx', unix_group_name=new_unix_group_name)
|
45 |
project.database = 'project:' + new_shortname.replace('/', ':').replace('-', '_')
|
45 |
project.database = 'project:' + new_shortname.replace('/', ':').replace('-', '_')
|
46 |
project.deleted = False
|
46 |
project.deleted = False
|
47 |
conn = M.main_doc_session.bind.conn
|
47 |
conn = M.main_doc_session.bind.conn
|
48 |
if project.database in conn.database_names():
|
48 |
if project.database in conn.database_names():
|
49 |
raw_input('''Warning: database %s is already populated. If you do NOT want
|
49 |
raw_input('''Warning: database %s is already populated. If you do NOT want
|