Skip to content

Commit

Permalink
Fixed #17
Browse files Browse the repository at this point in the history
Updated render_html_skel to use distutils.dir_util.copy_tree
  • Loading branch information
vrypan committed Oct 17, 2013
1 parent 9209b28 commit 70fee82
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions bucket3/bucket.py
Expand Up @@ -4,6 +4,7 @@
import os
import sys
import shutil
from distutils.dir_util import copy_tree
from datetime import datetime
import time
import calendar
Expand Down Expand Up @@ -420,21 +421,13 @@ def rq_do(self):
# MORE HERE!!!

def render_html_skel(self):
assets_dir = os.path.join(self.html_dir, '_')

if not os.path.exists(assets_dir):
os.makedirs(assets_dir)

for x in ['css', 'js', 'img']:
# create /_/<x> and populate with css files from _assets/<x>
x_dir = os.path.join(assets_dir, x)
if self.verbose:
print " Populating /_/%s..." % x,
if not os.path.exists(x_dir):
os.mkdir(x_dir)
for f in os.listdir(os.path.join(self.root_dir, '.bucket3', 'themes', self.theme, 'assets', x)):
shutil.copy2(os.path.join(self.root_dir, '.bucket3', 'themes', self.theme, 'assets', x, f), x_dir)
if self.verbose:
if self.verbose:
print " Populating /_/...",
copy_tree(
os.path.join(self.root_dir, '.bucket3', 'themes', self.theme, 'assets'),
os.path.join(self.html_dir, '_')
)
if self.verbose:
print "Done."

if os.path.exists(os.path.join( self.root_dir, '.bucket3', 'themes', self.theme, 'robots.txt')):
Expand Down

0 comments on commit 70fee82

Please sign in to comment.