Skip to content

Commit

Permalink
Fixed autodocs
Browse files Browse the repository at this point in the history
  • Loading branch information
shichao-an committed Apr 10, 2015
1 parent de5ce6b commit e2ee9a9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions u115/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ def _init_cookies(self):
self.cookies = cookies_class(f)

def load_cookies(self, ignore_discard=True, ignore_expires=True):
"""Load cookies from the file `API.cookies_filename`"""
"""Load cookies from the file :attribute:`API.cookies_filename`"""
self._init_cookies()
if os.path.exists(self.cookies.filename):
self.cookies.load(ignore_discard=ignore_discard,
ignore_expires=ignore_expires)
self._reset_cache()

def save_cookies(self, ignore_discard=True, ignore_expires=True):
"""Save cookies to the file `API.cookies_filename`"""
"""Save cookies to the file :attribute:`API.cookies_filename`"""
if not isinstance(self.cookies, cookielib.FileCookieJar):
m = 'Cookies must be a cookielib.FileCookieJar object to be saved.'
raise APIError(m)
Expand Down Expand Up @@ -377,7 +377,7 @@ def get_tasks(self, count=30):

def add_task_bt(self, filename, select=False):
"""
Added a new BT task
Add a new BT task
:param str filename: path to torrent file to upload
:param bool select: whether to select files in the torrent.
Expand All @@ -397,6 +397,8 @@ def add_task_bt(self, filename, select=False):

def add_task_url(self, target_url):
"""
Add a new URL task
:param str target_url: the URL of the file that to be downloaded
"""
Expand All @@ -423,7 +425,7 @@ def upload(self, filename, directory=None):
:param str filename: path to the file to upload
:param directory: destionation :class:`.Directory`, defaults to
:class:`.API.downloads_directory` if None
:attribute:`.API.downloads_directory` if None
:return: the uploaded file
:rtype: :class:`.File`
"""
Expand Down Expand Up @@ -693,7 +695,7 @@ def _req_files_edit(self, fid, file_name=None, is_mark=0):
def _req_files_add(self, pid, cname):
"""
Add a directory
:param int pid: parent directory id
:param str pid: parent directory id
:param str cname: directory name
"""
url = self.web_api_url + '/add'
Expand All @@ -709,7 +711,7 @@ def _req_files_add(self, pid, cname):
def _req_files_move(self, pid, fids):
"""
Move files or directories
:param int pid: target directory id
:param str pid: target directory id
:param list fids: a list of ids of files or directories to be moved
"""
url = self.web_api_url + '/move'
Expand Down Expand Up @@ -1076,7 +1078,7 @@ def get_download_url(self):

@property
def url(self):
"""Alias for :func:`File.get_download_url`"""
"""Alias for :method:`File.get_download_url`"""
return self.get_download_url()

def download(self, path=None, show_progress=True, resume=True,
Expand All @@ -1103,7 +1105,7 @@ def open_torrent(self):
class Directory(BaseFile):
"""
:ivar str cid: cid of this directory
:ivar int pid: represents the parent directory it belongs to
:ivar str pid: represents the parent directory it belongs to
:ivar int count: number of entries in this directory
:ivar datetime.datetime date_created: integer, originally named `t`
:ivar str pickcode: string, originally named `pc`
Expand Down

0 comments on commit e2ee9a9

Please sign in to comment.