tegift.blogg.se

Seafile api
Seafile api










seafile api

> - seafile_api.get_file_id_by_commit_and_path() > - seafile_api.get_dir_id_by_commit_and_path()

seafile api

> - seafile_api.delete_repo_tokens_by_peer_id() > - seafile_api.check_repo_access_permission() This list is based on **seafile-server-3.0.3**, and parameter was omitted.įor more infomation about Seafile-API, please see (). Loading seafile config from /home/foo/haiwen/seafile-data Loading ccnet config from /home/foo/haiwen/ccnet If you execute script file successfully, you will see these output, and of course a new library at myhome page of. New_repo_id, count_files_recursive(new_repo_id)) Origin_repo_id, count_files_recursive(origin_repo_id), Seafile_api.copy_file(origin_repo_id, '/', obj_name, new_repo_id, '/', #Copy stuffs from old library to new libraryĭirents = seafile_api.list_dir_by_path(origin_repo_id, '/') New_repo_id = seafile_api.create_repo(name=origin_repo.name, #Create a new library, set name, desc and owner Username = seafile_api.get_repo_owner(origin_repo_id) Origin_repo = seafile_api.get_repo(origin_repo_id) Num_files += count_files_recursive(repo_id, Copy stuffs from old library to new library.ĭef count_files_recursive(repo_id, path='/'):įor e in seafile_api.list_dir_by_path(repo_id, path): Create a new library, set name, desc and owner.ġ. Then `seaf_migrate_3.py` will call Seafile-API to copy library:ġ. > **NOTE:**You can get `repo_id` at address bar of Seahub or through () TOPDIR=$(dirname "$/seafile/lib64/python2.7/site-packages:$PYTHONPATH INSTALLPATH=$(dirname "$UPGRADE_DIR") # haiwen/seafile-server-3.0.3/ UPGRADE_DIR=$(dirname "$SCRIPT") # haiwen/seafile-server-3.0.3/upgrade/ SCRIPT=$(readlink -f "$0") # haiwen/seafile-server-3.0.3/upgrade/seaf_migrate_3.sh get ccnet/seafile config file path and export them If you want use Seafile-API, set environment variable first. We put them in the **upgrade** directory as you see above. In this example, two script files will be used: `seaf_migrate_3.sh` and `seaf_migrate_3.py`. And your directory layout will be like this:

Seafile api how to#

This tutorial show you how to use seafile-api, and will accomplish a "library copy" work under **Ubuntu** as example.įirst of all, make sure you have () successfully.












Seafile api