From dee42e7a814d3bc0f08a1c0955282ef6d1bc5873 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 29 Jun 2008 10:20:59 +0200 Subject: [PATCH] Docstring updates This patch changes the docstring not to use tabs any longer (they make pydoc output look not very nice) and changes the top-level example to show that listxattr now returns a list not a tuple. --- xattr.c | 106 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/xattr.c b/xattr.c index 25bc169..0f02a66 100644 --- a/xattr.c +++ b/xattr.c @@ -21,15 +21,15 @@ static char __pygetxattr_doc__[] = "Get the value of a given extended attribute.\n" "\n" "Parameters:\n" - "\t- a string representing filename, or a file-like object,\n" - "\t or a file descriptor; this represents the file on \n" - "\t which to act\n" - "\t- a string, representing the attribute whose value to retrieve;\n" - "\t usually in form of system.posix_acl or user.mime_type\n" - "\t- (optional) a boolean value (defaults to false), which, if\n" - "\t the file name given is a symbolic link, makes the\n" - "\t function operate on the symbolic link itself instead\n" - "\t of its target;" + " - a string representing filename, or a file-like object,\n" + " or a file descriptor; this represents the file on \n" + " which to act\n" + " - a string, representing the attribute whose value to retrieve;\n" + " usually in form of system.posix_acl or user.mime_type\n" + " - (optional) a boolean value (defaults to false), which, if\n" + " the file name given is a symbolic link, makes the\n" + " function operate on the symbolic link itself instead\n" + " of its target;" ; static PyObject * @@ -94,23 +94,23 @@ static char __pysetxattr_doc__[] = "replace)\n" "\n" "Parameters:\n" - "\t- a string representing filename, or a file-like object,\n" - "\t or a file descriptor; this represents the file on \n" - "\t which to act\n" - "\t- a string, representing the attribute whose value to set;\n" - "\t usually in form of system.posix_acl or user.mime_type\n" - "\t- a string, possibly with embedded NULLs; note that there\n" - "\t are restrictions regarding the size of the value, for\n" - "\t example, for ext2/ext3, maximum size is the block size\n" - "\t- (optional) flags; if 0 or ommited the attribute will be \n" - "\t created or replaced; if XATTR_CREATE, the attribute \n" - "\t will be created, giving an error if it already exists;\n" - "\t of XATTR_REPLACE, the attribute will be replaced,\n" - "\t giving an error if it doesn't exists;\n" - "\t- (optional) a boolean value (defaults to false), which, if\n" - "\t the file name given is a symbolic link, makes the\n" - "\t function operate on the symbolic link itself instead\n" - "\t of its target;" + " - a string representing filename, or a file-like object,\n" + " or a file descriptor; this represents the file on \n" + " which to act\n" + " - a string, representing the attribute whose value to set;\n" + " usually in form of system.posix_acl or user.mime_type\n" + " - a string, possibly with embedded NULLs; note that there\n" + " are restrictions regarding the size of the value, for\n" + " example, for ext2/ext3, maximum size is the block size\n" + " - (optional) flags; if 0 or ommited the attribute will be \n" + " created or replaced; if XATTR_CREATE, the attribute \n" + " will be created, giving an error if it already exists;\n" + " of XATTR_REPLACE, the attribute will be replaced,\n" + " giving an error if it doesn't exists;\n" + " - (optional) a boolean value (defaults to false), which, if\n" + " the file name given is a symbolic link, makes the\n" + " function operate on the symbolic link itself instead\n" + " of its target;" ; /* Wrapper for setxattr */ @@ -152,15 +152,15 @@ static char __pyremovexattr_doc__[] = "Remove an attribute from a file\n" "\n" "Parameters:\n" - "\t- a string representing filename, or a file-like object,\n" - "\t or a file descriptor; this represents the file on \n" - "\t which to act\n" - "\t- a string, representing the attribute to be removed;\n" - "\t usually in form of system.posix_acl or user.mime_type\n" - "\t- (optional) a boolean value (defaults to false), which, if\n" - "\t the file name given is a symbolic link, makes the\n" - "\t function operate on the symbolic link itself instead\n" - "\t of its target;" + " - a string representing filename, or a file-like object,\n" + " or a file descriptor; this represents the file on \n" + " which to act\n" + " - a string, representing the attribute to be removed;\n" + " usually in form of system.posix_acl or user.mime_type\n" + " - (optional) a boolean value (defaults to false), which, if\n" + " the file name given is a symbolic link, makes the\n" + " function operate on the symbolic link itself instead\n" + " of its target;\n" ; /* Wrapper for removexattr */ @@ -199,13 +199,13 @@ static char __pylistxattr_doc__[] = "Return the list of attribute names for a file\n" "\n" "Parameters:\n" - "\t- a string representing filename, or a file-like object,\n" - "\t or a file descriptor; this represents the file to \n" - "\t be queried\n" - "\t- (optional) a boolean value (defaults to false), which, if\n" - "\t the file name given is a symbolic link, makes the\n" - "\t function operate on the symbolic link itself instead\n" - "\t of its target;" + " - a string representing filename, or a file-like object,\n" + " or a file descriptor; this represents the file to \n" + " be queried\n" + " - (optional) a boolean value (defaults to false), which, if\n" + " the file name given is a symbolic link, makes the\n" + " function operate on the symbolic link itself instead\n" + " of its target;\n" ; /* Wrapper for listxattr */ @@ -295,17 +295,17 @@ static char __xattr_doc__[] = \ "value which enables the 'l-' version of the functions - acting\n" "on symbolic links and not their destination.\n" "\n" - "Example: \n" - ">>> import xattr\n" - ">>> xattr.listxattr(\"file.txt\")\n" - "('user.mime_type',)\n" - ">>> xattr.getxattr(\"file.txt\", \"user.mime_type\")\n" - "'text/plain'\n" - ">>> xattr.setxattr(\"file.txt\", \"user.comment\", \"Simple text file\")" - "\n" - ">>> xattr.listxattr(\"file.txt\")\n" - "('user.mime_type', 'user.comment')\n" - ">>> xattr.removexattr (\"file.txt\", \"user.comment\")\n" + "Example: \n\n" + " >>> import xattr\n" + " >>> xattr.listxattr(\"file.txt\")\n" + " ['user.mime_type']\n" + " >>> xattr.getxattr(\"file.txt\", \"user.mime_type\")\n" + " 'text/plain'\n" + " >>> xattr.setxattr(\"file.txt\", \"user.comment\", " + "\"Simple text file\")\n" + " >>> xattr.listxattr(\"file.txt\")\n" + " ['user.mime_type', 'user.comment']\n" + " >>> xattr.removexattr (\"file.txt\", \"user.comment\")\n" "" ; -- 2.39.2