[library-web/new-website-style: 8/24] Copy images/ directory to web root



commit ba485b22c79546a4a2cfb2acf9650a06b89c7cae
Author: Frédéric Péters <fpeters 0d be>
Date:   Sat Mar 19 22:06:53 2011 +0100

    Copy images/ directory to web root

 src/app.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/app.py b/src/app.py
index 688ecc6..7e3381d 100644
--- a/src/app.py
+++ b/src/app.py
@@ -44,6 +44,7 @@ class App:
     default_indexes_xsl_file = os.path.join(data_dir, 'xslt', 'indexes.xsl')
     javascript_dir = os.path.join(data_dir, 'js')
     skin_dir = os.path.join(data_dir, 'skin')
+    images_dir = os.path.join(data_dir, 'images')
 
     rebuild_all = False
     debug = False
@@ -110,6 +111,12 @@ class App:
             shutil.rmtree(skin_dir)
         shutil.copytree(self.skin_dir, os.path.join(self.config.output_dir, 'skin'))
 
+        if os.path.exists(self.images_dir):
+            images_dir = os.path.join(self.config.output_dir, 'images')
+            if os.path.exists(images_dir):
+                shutil.rmtree(images_dir)
+            shutil.copytree(self.images_dir, os.path.join(self.config.output_dir, 'images'))
+
     def download(self, url):
         parsed_url = urllib2.urlparse.urlparse(url)
         if parsed_url[0] == 'file':



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]