[Python-modules-commits] r10636 - in packages/pastescript/trunk/debian (3 files)

piotr at users.alioth.debian.org piotr at users.alioth.debian.org
Mon Nov 30 22:38:30 UTC 2009


    Date: Monday, November 30, 2009 @ 22:38:29
  Author: piotr
Revision: 10636

* extend paster_templates pattern
* add README.Debian

Added:
  packages/pastescript/trunk/debian/README.Debian
Modified:
  packages/pastescript/trunk/debian/changelog
  packages/pastescript/trunk/debian/patches/03_try_to_find_templates_in_system_dir.dpatch

Added: packages/pastescript/trunk/debian/README.Debian
===================================================================
--- packages/pastescript/trunk/debian/README.Debian	                        (rev 0)
+++ packages/pastescript/trunk/debian/README.Debian	2009-11-30 22:38:29 UTC (rev 10636)
@@ -0,0 +1,30 @@
+paster for Debian
+-----------------
+
+paste.script.templates module (i.e. `paster create --template=foo`) is modified
+in Debian to look for templates in ``/usr/local/share/paster_templates/`` and
+``/usr/share/paster_templates/`` before it will try standard locations.
+
+This allows package maintainers to move templates outside site-packages
+directory (think about FHS) and local administrators to modify these templates.
+
+
+To package maintainers
+----------------------
+There's no need to patch upstream code in order to remove .*templates directory
+from _template_dir - modified paster will try to guess the right directory.
+
+examples:
+^^^^^^^^^
+
+ | in:  ``_template_dir = ('pylons', 'templates/default_project')``
+ | out: ``/usr/share/paster_templates/pylons/default_project``
+
+ | in:  ``_template_dir = ('formalchemy', 'paster_templates/pylons_fa')``
+ | out: ``/usr/share/paster_templates/formalchemy/pylons_fa``
+
+ | in:  ``_template_dir = 'paster_templates/paste_deploy'``
+ | out: ``/usr/share/paster_templates/paste_deploy``
+
+ | in:  ``_template_dir = 'foo/templates/bar'``
+ | out: ``/usr/share/paster_templates/foo/bar``

Modified: packages/pastescript/trunk/debian/changelog
===================================================================
--- packages/pastescript/trunk/debian/changelog	2009-11-30 19:50:12 UTC (rev 10635)
+++ packages/pastescript/trunk/debian/changelog	2009-11-30 22:38:29 UTC (rev 10636)
@@ -1,10 +1,10 @@
-pastescript (1.7.3-5) UNRELEASED; urgency=low
+pastescript (1.7.3-5) unstable; urgency=low
 
   * Add 03_try_to_find_templates_in_system_dir patch so that paster will try
     to find templates in /usr/local/share/paster_templates/ and
     /usr/share/paster_templates/ first.
 
- -- Piotr Ożarowski <piotr at debian.org>  Thu, 29 Oct 2009 10:05:56 +0100
+ -- Piotr Ożarowski <piotr at debian.org>  Mon, 30 Nov 2009 22:38:54 +0100
 
 pastescript (1.7.3-4) unstable; urgency=low
 

Modified: packages/pastescript/trunk/debian/patches/03_try_to_find_templates_in_system_dir.dpatch
===================================================================
--- packages/pastescript/trunk/debian/patches/03_try_to_find_templates_in_system_dir.dpatch	2009-11-30 19:50:12 UTC (rev 10635)
+++ packages/pastescript/trunk/debian/patches/03_try_to_find_templates_in_system_dir.dpatch	2009-11-30 22:38:29 UTC (rev 10636)
@@ -24,7 +24,7 @@
 +        """Returns full path to template directory if it's found in
 +        /usr/local/share/paster_templates/ or /usr/share/paster_templates/"""
 +
-+        tpldir_pattern = re.compile('/[^/]*templates/')
++        tpldir_pattern = re.compile('[^/]*templates/')
 +
 +        for d in ('/usr/local/share/paster_templates/', '/usr/share/paster_templates/'):
 +            directory = os.path.join(d, *args)
@@ -32,7 +32,7 @@
 +                return directory
 +            # remove .*templates directory if it's in the args and try again
 +            args_joined = os.path.join(*args)
-+            directory = os.path.join(d, tpldir_pattern.sub('/', args_joined))
++            directory = os.path.abspath(os.path.join(d, tpldir_pattern.sub('./', args_joined)))
 +            if os.path.isdir(directory):
 +                return directory
 +




More information about the Python-modules-commits mailing list