+ add_to_file(os.path.join(tmp, f), "/%s" % f)
+
+ if options.get('uplodaded_files', False):
+ state['overall']['status'] = _('Importing uploaded files')
+ set_state()
+ export_upfiles(t)
+
+ if options.get('import_skins_folder', False):
+ state['overall']['status'] = _('Importing skins folder')
+ set_state()
+ export_skinsfolder(t)
+
+ 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)