From 1d8ad600d9a4f80142484cd6379fa9436ed6c139 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 24 Dec 2002 01:51:37 +0000 Subject: [PATCH] Added new files, some example in the docstrings --- MANIFEST.in | 4 ++++ setup.cfg | 3 +++ setup.py | 5 ++++- xattr.c | 14 +++++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 MANIFEST.in create mode 100644 setup.cfg diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..6e5a95d --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include README +include xattr.html +include xattr.txt +include xattr.c diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..3dc2ff3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[bdist_rpm] +release = 1 +changelog = ChangeLog diff --git a/setup.py b/setup.py index dd2cfa6..75a2409 100644 --- a/setup.py +++ b/setup.py @@ -6,9 +6,10 @@ from distutils.core import setup, Extension long_desc = """This is a C extension module for Python which implements extended attributes manipulation. It is a wrapper on top of the attr C library - see attr(5).""" +version = "0.1" setup(name="pyxattr", - version="0.1", + version=version, description="Extended attributes for python", long_description=long_desc, author="Iustin Pop", @@ -16,4 +17,6 @@ setup(name="pyxattr", url="http://pyxattr.sourceforge.net", license="GPL", ext_modules=[Extension("xattr", ["xattr.c"], libraries=["attr"])], + data_files=[("/usr/share/doc/pyxattr-%s" % version, + ["README", "xattr.html", "xattr.txt"])] ) diff --git a/xattr.c b/xattr.c index b17e737..3287adb 100644 --- a/xattr.c +++ b/xattr.c @@ -169,7 +169,7 @@ pyremovexattr(PyObject *self, PyObject *args) } static char __pylistxattr_doc__[] = \ -"Return the list of attribute names from a file\n" \ +"Return the tuple of attribute names from a file\n" \ "\n" \ "Parameters:\n" \ "\t- a string representing filename, or a file-like object,\n" \ @@ -255,6 +255,18 @@ static char __xattr_doc__[] = \ "This module gives access to the extended attributes present\n" \ "in some operating systems/filesystems. You can list attributes,\n"\ "get, set and remove them.\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" \ +"" \ ; void -- 2.39.5