Пример #1
0
def restore(input):
    if not os.path.exists(input):
        print "Warning! %s is not existed." % input
        return
    if not os.path.isdir(input):
        print "Loading %s" % input
        
        file = BackupFile(input)
        result = file.load()
        
        model_class = file.get_model_class()        
        print "Uploading data to %s..." % model_class.kind()
        app.upload_model(model_class,result)
    else:
        regexp = re.compile("^.*\.json$")
        for file in os.listdir(input):
            if regexp.match(file):
                restore(input +"/" +file)