Esempio n. 1
0
def setup(setup_func):
    def mkdir_handler(err, result):
        setup_func()
    def exists_handler(err, exists):
        if exists:
            def delete_handler(err, result):
                FileSystem.mkdir(FILEDIR, handler=mkdir_handler)
            FileSystem.delete_recursive(FILEDIR, delete_handler)
        else:
            FileSystem.mkdir(FILEDIR, handler=mkdir_handler)
    FileSystem.exists(FILEDIR, exists_handler)
Esempio n. 2
0
def setup(setup_func):
    def mkdir_handler(err, result):
        setup_func()

    def exists_handler(err, exists):
        if exists:

            def delete_handler(err, result):
                FileSystem.mkdir(FILEDIR, handler=mkdir_handler)

            FileSystem.delete_recursive(FILEDIR, delete_handler)
        else:
            FileSystem.mkdir(FILEDIR, handler=mkdir_handler)

    FileSystem.exists(FILEDIR, exists_handler)