[Checkins] SVN: cc.buildout_reports/trunk/ Include the package data with the egg; attempt to chmod the script at run time if necessary.

Nathan Yergler nathan at yergler.net
Wed Aug 22 14:33:30 EDT 2007


Log message for revision 79142:
  Include the package data with the egg; attempt to chmod the script at run time if necessary.

Changed:
  U   cc.buildout_reports/trunk/cc/buildout_reports/xxx.py
  U   cc.buildout_reports/trunk/setup.py

-=-
Modified: cc.buildout_reports/trunk/cc/buildout_reports/xxx.py
===================================================================
--- cc.buildout_reports/trunk/cc/buildout_reports/xxx.py	2007-08-22 18:31:33 UTC (rev 79141)
+++ cc.buildout_reports/trunk/cc/buildout_reports/xxx.py	2007-08-22 18:33:30 UTC (rev 79142)
@@ -17,6 +17,7 @@
 import cc.buildout_reports
 
 import os
+import stat
 import logging
 import subprocess
 import zc.buildout
@@ -61,15 +62,22 @@
             options['report_file'] = os.path.abspath(options['report_file'])
 
 
+        # determine the name of our script
+        self.script_name = os.path.join(
+            os.path.dirname(cc.buildout_reports.__file__),
+            'xxx_report.sh')
+
+        # make sure it's executable
+        if not(os.access(self.script_name, os.X_OK)):
+            # attempt to chmod it... sigh...
+            os.chmod(self.script_name,
+                     stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR|
+                     stat.S_IXGRP|stat.S_IXOTH)
+
     def install(self):
         """Generate the XXX report for this project."""
 
-        paths = []
-        script_name = os.path.join(
-            os.path.dirname(cc.buildout_reports.__file__),
-            'xxx_report.sh')
-
-        subprocess.call([script_name,
+        subprocess.call([self.script_name,
                          self.buildout['buildout']['directory'],
                          self.options['report_file'],
                          self.options['pattern']

Modified: cc.buildout_reports/trunk/setup.py
===================================================================
--- cc.buildout_reports/trunk/setup.py	2007-08-22 18:31:33 UTC (rev 79141)
+++ cc.buildout_reports/trunk/setup.py	2007-08-22 18:33:30 UTC (rev 79142)
@@ -34,6 +34,7 @@
     entry_points = {'zc.buildout':['xxx = cc.buildout_reports:XxxReport'],
                     },
     zip_safe = False,
+    include_package_data = True,
     
     # author metadata
     author = 'Nathan R. Yergler',



More information about the Checkins mailing list