+ state['overall']['status'] = _('Writing inf file.')
+ set_state()
+
+ inf = ConfigParser.SafeConfigParser()
+
+ inf.add_section(DATE_AND_AUTHOR_INF_SECTION)
+
+ inf.set(DATE_AND_AUTHOR_INF_SECTION, 'file-name', full_fname)
+ inf.set(DATE_AND_AUTHOR_INF_SECTION, 'author', unicode(user.id))
+ inf.set(DATE_AND_AUTHOR_INF_SECTION, 'site', djsettings.APP_URL)
+ inf.set(DATE_AND_AUTHOR_INF_SECTION, 'started', start_time.strftime(DATETIME_FORMAT))
+ inf.set(DATE_AND_AUTHOR_INF_SECTION, 'finished', now.strftime(DATETIME_FORMAT))
+
+ inf.add_section(OPTIONS_INF_SECTION)
+ inf.set(OPTIONS_INF_SECTION, 'anon-data', str(options.get('anon_data', False)))
+ inf.set(OPTIONS_INF_SECTION, 'with-upfiles', str(options.get('uplodaded_files', False)))
+ inf.set(OPTIONS_INF_SECTION, 'with-skins', str(options.get('import_skins_folder', False)))
+
+ inf.add_section(META_INF_SECTION)
+
+ for id, s in state.items():
+ inf.set(META_INF_SECTION, id, str(s['count']))
+
+ with open(os.path.join(tmp, '%s.backup.inf' % fname), 'wb') as inffile:
+ inf.write(inffile)
+
+ add_to_file(os.path.join(tmp, '%s.backup.inf' % fname), '/backup.inf')
+ state['overall']['status'] = _('Saving backup file')
+ set_state()