def ResetStorage(key, randomize=None, sure=False): if not sure: oc = ObjectContainer(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 resetStorage(key) return AdvancedMenu( randomize=timestamp(), header='Success', message='Subtitle Information Storage reset' )
def ResetStorage(key, randomize=None, sure=False): if not sure: oc = ObjectContainer(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 resetStorage(key) return AdvancedMenu(randomize=timestamp(), header='Success', message='Subtitle Information Storage reset')
def ResetStorage(key, randomize=None, sure=False): if not sure: oc = ObjectContainer(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 resetStorage(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 = ObjectContainer(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 resetStorage(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 )