Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
AshotS committed Sep 17, 2017
1 parent e6c2b49 commit 2803fe8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
14 changes: 0 additions & 14 deletions README.md

This file was deleted.

36 changes: 36 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
python-seafile-api
======

This is fork of https://github.com/haiwen/python-seafile with support some additional features.

Requirements
------
- Python 3.x
- `Requests <http://www.python-requests.org/en/latest/>`

Getting started
---------------

The documentation gives some examples in more detail, as well as a full API specification, but here are the basics to get you started:

.. code:: python
import seafileapi
client=seafileapi.connect('http://address:8000', 'admin@email.com', 'password')
client.admin.list_accounts()
Out[17]:
[SeafileAccount<id=1, user=sdsd@sdfsds.ru>,
SeafileAccount<id=62, user=test@test.com>,
SeafileAccount<id=104, user=ddd1@ddd.ru>]
client.repos.create_repo('new_repo')
Out[19]: SefileRepo<id=63ca0c53-7d8c-470c-b0a9-260afa755079, name=new_repo>
API Documentation
------
https://manual.seafile.com/develop/web_api_v2.1.html
6 changes: 4 additions & 2 deletions seafileapi/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ class Repos:
def __init__(self, client):
self.client = client

def create_repo(self, name, desc, password=None):
def create_repo(self, name, desc=None, password=None):
"""
:param name:
:param desc:
:param password:
:return:
"""
data = {'name': name, 'desc': desc}
data = {'name': name}
if desc:
data.update({'desc': desc})
if password:
data['passwd'] = password
repo_json = self.client.post(self.REPOS_URL, data=data).json()
Expand Down

0 comments on commit 2803fe8

Please sign in to comment.