[Python-checkins] distutils2: Add example for data-files documentation

tarek.ziade python-checkins at python.org
Wed Feb 16 22:23:57 CET 2011


tarek.ziade pushed 681504f2a84a to distutils2:

http://hg.python.org/distutils2/rev/681504f2a84a
changeset:   1042:681504f2a84a
parent:      1039:7f6a4b4b6e7b
user:        FELD Boris <lothiraldan at gmail.com>
date:        Sat Jan 29 14:41:47 2011 +0100
summary:
  Add example for data-files documentation

files:
  distutils2/_backport/pkgutil.py
  docs/design/wiki.rst
  docs/source/setupcfg.rst

diff --git a/distutils2/_backport/pkgutil.py b/distutils2/_backport/pkgutil.py
--- a/distutils2/_backport/pkgutil.py
+++ b/distutils2/_backport/pkgutil.py
@@ -613,7 +613,7 @@
 # PEP 376 Implementation #
 ##########################
 
-DIST_FILES = ('INSTALLER', 'METADATA', 'RECORD', 'REQUESTED',)
+DIST_FILES = ('INSTALLER', 'METADATA', 'RECORD', 'REQUESTED', 'RESOURCES')
 
 # Cache
 _cache_name = {} # maps names to Distribution instances
@@ -1167,3 +1167,6 @@
     for dist in get_distributions():
         if dist.uses(path):
             yield dist
+
+def open(distribution_name, relative_path):
+    
diff --git a/docs/design/wiki.rst b/docs/design/wiki.rst
--- a/docs/design/wiki.rst
+++ b/docs/design/wiki.rst
@@ -250,8 +250,8 @@
 ==  ====================================  ===================================================================================================
 1   mailman/database/schemas/blah.schema  /var/mailman/schemas/blah.schema
 2   some.tpl                              /var/mailman/templates/some.tpl
-3   path/to/some.tpl                      /var/mailman/templates/path/to/some.tpl
-4   mailman/database/mailman.db           /var/mailman/database/mailman.db
+3   path/to/some.tpl                      /var/mailman/templates/path/to/some.tpl !
+4   mailman/database/mailman.db           /var/mailman/database/mailman.db !
 5   developer-docs/index.txt              /usr/share/doc/mailman/developer-docs/index.txt
 6   developer-docs/api/toc.txt            /usr/share/doc/mailman/developer-docs/api/toc.txt
 7   README                                /usr/share/doc/mailman/README
@@ -259,7 +259,7 @@
 9   mailman/foo/some/path/bar/my.cfg      /etc/mailman/baz/some/path/bar/my.cfg AND
                                           /etc/mailman/hmm/some/path/bar/my.cfg + 
                                           emit a warning
-10  mailman/foo/some/path/other.cfg       /etc/mailman/some/path/other.cfg
+10  mailman/foo/some/path/other.cfg       /etc/mailman/some/path/other.cfg !
 11  some-new-semantic.sns                 /var/funky/mailman/some-new-semantic.sns
 ==  ====================================  ===================================================================================================
 
diff --git a/docs/source/setupcfg.rst b/docs/source/setupcfg.rst
--- a/docs/source/setupcfg.rst
+++ b/docs/source/setupcfg.rst
@@ -163,24 +163,6 @@
 
 The destination path will be expanded at the installation time using categories's default-path in the sysconfig.cfg file in the system. For more information about categories's default-paths, take a look at next next sub-section destination_.
 
-So, if you have this source tree::
-
-  mailman-1.0/
-    README
-    scripts/
-      start.sh
-      start.py
-      start.bat
-      LAUNCH
-    docs/
-      index.rst
-    mailman/
-      databases/
-        main.db
-      mailman.py
-
-
-
 
 .. _globsyntax:
 
@@ -257,6 +239,109 @@
 
 So, if you have this destination path : **{help}/api**, it will be expanded into **{datadir}/{distribution.name}/api**. {datadir} will be expanded depending on your system value (ex : confdir = datadir = /usr/share/).
 
+
+Simple-example
+--------------
+
+Source tree::
+
+  babar-1.0/
+    README
+    babar.sh
+    launch.sh
+    babar.py
+    
+Setup.cfg::
+
+  [RESOURCES]
+  README = {doc}
+  *.sh = {scripts}
+  
+So babar.sh and launch.sh will be placed in {scripts} directory.
+
+Now let's create to move all the scripts into a scripts/directory.
+
+Second-example
+--------------
+
+Source tree::
+
+  babar-1.1/
+    README
+    scripts/
+      babar.sh
+      launch.sh
+      LAUNCH
+    babar.py
+    
+Setup.cfg::
+
+  [RESOURCES]
+  README = {doc}
+  scripts/ LAUNCH = {scripts}
+  scripts/ *.sh = {scripts}
+  
+It's important to use the separator after scripts/ to install all the bash scripts into {scripts} instead of {scripts}/scripts.
+
+Now let's add some docs.
+
+Third-example
+-------------
+
+Source tree::
+
+  babar-1.2/
+    README
+    scripts/
+      babar.sh
+      launch.sh
+      LAUNCH
+    docs/
+      api
+      man
+    babar.py
+
+Setup.cfg::
+
+  [RESOURCES]
+  README = {doc}
+  scripts/ LAUNCH = {doc}
+  scripts/ *.sh = {scripts}
+  doc/ * = {doc}
+  doc/ man = {man}
+  
+You want to place all the file in the docs script into {doc} category, instead of man, which must be placed into {man} category, we will use the order of declaration of globs to choose the destination, the last glob that match the file is used.
+
+Now let's add some scripts for windows users.
+  
+Final example
+-------------
+
+Source tree::
+
+  babar-1.3/
+    README
+    doc/
+      api
+      man
+    scripts/  
+      babar.sh
+      launch.sh
+      babar.bat
+      launch.bat
+      LAUNCH
+
+Setup.cfg::
+
+  [RESOURCES]
+  README = {doc}
+  scripts/ LAUNCH = {doc}
+  scripts/ *.{sh,bat} = {scripts}
+  doc/ * = {doc}
+  doc/ man = {man}
+
+We use brace expansion syntax to place all the bash and batch scripts into {scripts} category.    
+
 command sections
 ================
 

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list