Changeset 143 for tags/0.3.2

Show
Ignore:
Timestamp:
02/27/06 16:46:38 (3 years ago)
Author:
tim
Message:

fixed a problem with .svn folders being copied into the build tree.. also it now copies over the images and styles on partial rebuilds

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tags/0.3.2/pyramid/build.py

    r137 r143  
    5454    for resourcedir in resourcedirs: 
    5555        dir, name = os.path.split(resourcedir) 
    56         if not os.path.exists(os.path.join(OUTPUTDIR,name)): 
    57             shutil.copytree(resourcedir,os.path.join(OUTPUTDIR,name)) 
     56        utils.copytree(resourcedir,os.path.join(OUTPUTDIR,name),nocopylist=['.svn']) 
    5857 
    5958    # change the working directory 
  • tags/0.3.2/pyramid/utils.py

    r96 r143  
    11import os 
     2import shutil 
    23 
    34class Stack: 
     
    111112 
    112113 
    113  
     114def copytree(src, dst, symlinks=0, nocopylist=[]): 
     115    names = os.listdir(src) 
     116    if not os.path.isdir(dst): 
     117        os.mkdir(dst) 
     118    for name in names: 
     119        srcname = os.path.join(src, name) 
     120        dstname = os.path.join(dst, name) 
     121        try: 
     122            if symlinks and os.path.islink(srcname): 
     123                linkto = os.readlink(srcname) 
     124                os.symlink(linkto, dstname) 
     125            elif os.path.isdir(srcname): 
     126                if name not in nocopylist: 
     127                    copytree(srcname, dstname, symlinks, nocopylist) 
     128            else: 
     129                shutil.copy2(srcname, dstname) 
     130        except (IOError, os.error), why: 
     131            print "Can't copy %s to %s: %s" % (`srcname`, `dstname`, str(why))