示例#1
0
文件: menu.py 项目: zemzela/Sub-Zero
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'
    )
示例#2
0
文件: menu.py 项目: utajum/Sub-Zero
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')
示例#3
0
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)
示例#4
0
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
    )