03-18-2022, 08:15 AM
(03-17-2022, 09:43 PM)bitlab Wrote:I think the "content.append()"is the "problem", as it will not overwrite if a config is present. Anyhow, I was not aware about that moodebackup.zip feature. That is exactly what I thought to prevent and do the restore. Will it also execute the optional script you put into the backup ?(03-17-2022, 02:46 PM)UpsiUps Wrote:Code:.... line 188 of backupmanager.py ...
if configPresent:
print('config')
content.append('config')
That's the reason, why the Source/Library entry is duplicated. Now, if I want to "restore" , why would i like to append it to the current moodecfg.ini ? I would rather think I would like to overwrite the moodecfg.ini even if it is in place, nor ?
That piece of code is just fine. That few lines just detect what is present in a backup file.
The only thing that is missing is that on restore first the already present source should be removed to allow multiple time restore of the ini.
But there is a much simpler workflow available: instead of the moodecfg.ini place the backup file renamed to moodebackup.zip in the boot partition.