Merge pull request #9 from focalism/master

Modify some description for file in docs
This commit is contained in:
Prodesire 2017-12-11 23:01:31 +08:00 committed by GitHub
commit 8bd61a13d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 10 deletions

View File

@ -15,17 +15,16 @@ File
Traceback (most recent call last):
... OSError: Create dir: test1 error.
.. py:function:: pydu.file.remove(path, mode=0o755, ignore_errors=False, onerror)
Remove a file or directory.
If ``ignore_errors`` is set, errors are ignored; otherwise, if onerror
is set, it is called to handle the error with arguments (func,
path, exc_info) where func is platform and implementation dependent;
path is the argument to that function that caused it to fail; and
exc_info is a tuple returned by sys.exc_info(). If ``ignore_errors``
is False and onerror is None, an exception is raised.
If ``ignore_errors`` is set, errors are ignored; otherwise, if `onerror`
is set, it is called to handle the error with arguments (`func` ,
`path` , `exc_info` ) where func is platform and implementation dependent;
`path` is the argument to that function that caused it to fail; and
`exc_info` is a tuple returned by `sys.exc_info()`. If `ignore_errors`
is `False` and `onerror` is None, an exception is raised.
>>> from pydu.file import makedirs
>>> from pydu.file import remove
@ -75,8 +74,6 @@ File
symlink will be created instead of copying the file it points to,else
the contents of the file pointed to by symbolic links is copied.
Example: Copy a symlink
>>> from pydu.file import copy,symlink
>>> from pydu.file import makedirs,open_fle
>>> open_fle('test/test.txt')
@ -104,7 +101,7 @@ File
``link`` only work on `Unix-like` system, it create a hard link pointing to
source named link_name.If dist is exist and overwrite is true,a
new symlink will be created.
new link will be created.
>>> from pydu.file import link
>>> link('test.txt','test.link')