def load_dropbox_save(name):
    def load_save(data):
        with open(get_download_path(), "wb") as f:
            f.write(data)
        _save.load_game(get_download_path())

    ui.message("Fetching save...")
    return ui.async(lambda: sync.request_with_sid("/sync/download", name=name), then=load_save)
def load_dropbox_save(name):
    def load_save(data):
        with open(get_download_path(), 'wb') as f:
            f.write(data)
        _save.load_game(get_download_path())

    ui.message('Fetching save...')
    return ui.async(lambda: sync.request_with_sid('/sync/download', name=name),
                    then=load_save)
 def _do():
     data = open(path, 'rb').read()
     sync.request_with_sid('/sync/upload_save',
                           name=name,
                           sharing=features.get('civsync.allow_sharing'),
                           post_data=data)
 def _do():
     data = open(path, 'rb').read()
     sync.request_with_sid('/sync/upload_save',
                           name=name,
                           sharing=features.get('civsync.allow_sharing'),
                           post_data=data)
 def callback(entry):
     ui.message('Fetching save...')
     return ui.async(lambda: sync.request_with_sid('/sync/download', name=entry),
                     then=load_save)
 def _do():
     data = open(path, "rb").read()
     sync.request_with_sid(
         "/sync/upload_save", name=name, sharing=features.get("civsync.allow_sharing"), post_data=data
     )