[Repoze-dev] Repoze CVS: __init__.py

Chris McDonough chrism at agendaless.com
Wed Sep 12 18:43:00 UTC 2007


Update of /home/repoze/cvs/repoze.obob/repoze/obob/templates
In directory laguna.palladion.com:/tmp/cvs-serv16471/repoze/obob/templates

Modified Files:
	__init__.py 
Log Message:
Monkeypatch around a bug in PasteScript 1.3.6.


Index: __init__.py
===================================================================
RCS file: /home/repoze/cvs/repoze.obob/repoze/obob/templates/__init__.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- __init__.py	12 Sep 2007 18:18:02 -0000	1.1
+++ __init__.py	12 Sep 2007 18:42:58 -0000	1.2
@@ -4,6 +4,31 @@
 from paste.script import templates
 from paste.script.templates import var
 
+import pkg_resources
+
+pastescriptv = pkg_resources.get_distribution('PasteScript').version.split('.')
+if pastescriptv <= ['1', '3', '6']:
+    # pastescript 1.3.6 has a bug in should_skip_file when a 'CVS' directory
+    # exists in the skeldir (missing name pad)
+    def should_skip_file(name):
+        """
+        Checks if a file should be skipped based on its name.
+
+        If it should be skipped, returns the reason, otherwise returns
+        None.
+        """
+        if name.startswith('.'):
+            return 'Skipping hidden file %(filename)s'
+        if name.endswith('~') or name.endswith('.bak'):
+            return 'Skipping backup file %(filename)s'
+        if name.endswith('.pyc'):
+            return 'Skipping .pyc file %(filename)s'
+        if name in ('CVS', '_darcs'):
+            return 'Skipping version control directory %(filename)s'
+        return None
+    from paste.script import copydir
+    copydir.should_skip_file = should_skip_file
+
 class NewBobTemplate(templates.Template):
     _template_dir = 'newbob_skel'
     summary = "A project with a namespace package"

_______________________________________________
Repoze-dev mailing list
Repoze-dev at lists.repoze.org
http://lists.repoze.org/mailman/listinfo/repoze-dev



More information about the Repoze-dev mailing list