def ResetStorage(key, randomize=None, sure=False): if not sure: oc = SubFolderObjectContainer(no_history=True, title1="Reset subtitle storage", title2="Are you sure?") oc.add( DirectoryObject( key=Callback(ResetStorage, key=key, sure=True, randomize=timestamp()), title=pad_title("Are you really sure?"), )) return oc reset_storage(key) if key == "tasks": # reinitialize the scheduler scheduler.init_storage() scheduler.setup_tasks() return AdvancedMenu(randomize=timestamp(), header='Success', message='Information Storage (%s) reset' % key)
def ResetStorage(key, randomize=None, sure=False): if not sure: oc = SubFolderObjectContainer( no_history=True, title1=_("Reset subtitle storage"), title2=_("Are you sure?")) oc.add(DirectoryObject( key=Callback( ResetStorage, key=key, sure=True, randomize=timestamp()), title=pad_title(_("Are you really sure?")), )) return oc reset_storage(key) if key == "tasks": # reinitialize the scheduler scheduler.init_storage() scheduler.setup_tasks() return AdvancedMenu( randomize=timestamp(), header=_("Success"), message=_("Information Storage (%s) reset", key) )