mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-06-23 13:47:56 +00:00
21 lines
472 B
Python
21 lines
472 B
Python
import os
|
|
import random
|
|
import string
|
|
|
|
from seaserv import ccnet_api, seafile_api
|
|
|
|
|
|
def create_and_get_repo(*a, **kw):
|
|
repo_id = seafile_api.create_repo(*a, **kw)
|
|
repo = seafile_api.get_repo(repo_id)
|
|
return repo
|
|
|
|
|
|
def randstring(length=12):
|
|
return ''.join(random.choice(string.lowercase) for i in range(length))
|
|
|
|
def create_and_get_group(*a, **kw):
|
|
group_id = ccnet_api.create_group(*a, **kw)
|
|
group = ccnet_api.get_group(group_id)
|
|
return group
|