Changeset 148

Show
Ignore:
Timestamp:
03/02/06 23:04:54 (3 years ago)
Author:
tim
Message:

added infinite recursion checking and fix for asset copying

Files:

Legend:

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

    r143 r148  
    2727 
    2828 
    29 def build(data,out,verbose=0,resourcedirs=[],rebuilddirs=None,partialbuild=False,constants=None,update=False): 
     29def build(data,out,verbose=0,resourcedirs=[],rebuilddirs=None,partialbuild=False,constants=None,update=False,copylist=[]): 
    3030 
    3131    DATADIR = os.path.abspath(data) 
     
    8787        if not os.path.isdir(os.path.join(OUTPUTDIR,root)): 
    8888            os.mkdir(os.path.join(OUTPUTDIR,root)) 
     89 
     90        for f in files: 
     91            suffix = os.path.splitext(f)[1] 
     92            if suffix[1:] in copylist: 
     93                srcfile = os.path.join(ctx.path,f) 
     94                targetfile = os.path.join(OUTPUTDIR,root,f) 
     95                shutil.copy(srcfile,targetfile)             
    8996     
    9097        # create the html from the index.yml fragment 
     
    160167                constants[key]=value 
    161168    else: 
    162         constants = None     
     169        constants = None   
     170         
     171    if options.copylist: 
     172        copylist = options.copylist.split(',') 
     173    else: 
     174        copylist = [] 
    163175 
    164     build(options.data,options.out,verbose=options.verbose,resourcedirs=resourcedirs,rebuilddirs=rebuilddirs,constants=constants,update=options.update
     176    build(options.data,options.out,verbose=options.verbose,resourcedirs=resourcedirs,rebuilddirs=rebuilddirs,constants=constants,update=options.update,copylist=options.copylist
    165177 
    166178 
     
    175187    parser.add_option("-R", "--rebuilddirs",dest="rebuilddirs",help="only rebuild below these comma separated directories",metavar="REBUILDDIRS") 
    176188    parser.add_option("-c", "--constants", dest="constants", help="pass in the names constants (e.g. PDO=/root/pdo,PSF=/psf", metavar="CONSTANTS") 
     189    parser.add_option("-C", "--copylist", dest="copylist", help="a list of file suffixes to copy from the data tree", metavar="COPYLIST") 
    177190    parser.add_option("-U", "--update", action="store_true", dest="update", default=False, help="NOT WORKING DO NOT USE try to build only those pages that have changed")     
    178191    (options, args) = parser.parse_args() 
  • tags/0.3.3/pyramid/flatteners.py

    r137 r148  
    184184    """  
    185185    searchpath = ctx.path 
    186     while searchpath != '': 
     186    #overkill checking for search path infinite recursion 
     187    while searchpath != '' and searchpath != '/' and searchpath != ctx.root: 
    187188        try: 
    188189            open(searchpath / path(template)) 
  • tags/0.3.3/setup.py

    r128 r148  
    22from distutils.core import setup 
    33setup(name='pyramid', 
    4       version='0.3.2', 
     4      version='0.3.3', 
    55      description='Pydotorg Website Build System', 
    66      author='Tim Parkin',