Esempio n. 1
0
    def asset (self, output=None, src=[], **kwargs):
        # print output, src, kwargs
        kwargs['environment'] = self
        name = kwargs.pop('name',None)
        if len(src)>1:
            pre = kwargs.pop('pre')
            asset = AssetCollection(**kwargs)
            kwargs.pop('processors')
            for _asset in src:
                if isinstance(_asset,basestring): _asset = self.asset(src=[_asset],pre=pre, **kwargs)
                asset.add(_asset)
        else:
            if not src and not name: 
                src = [output]
                output = '{path}{filename}'
            asset = self.single_asset(*src,**kwargs)

        if output:
            self.output(output,asset)
        if name:
            self._references[name] = asset
        return asset
Esempio n. 2
0
 def process_collection(self, assets, *args, **kwargs):
     """Return all the child resources or False, if there is no change"""
     new_assets = AssetCollection(environment=assets.environment, storage=assets.storage)
     for asset in assets:
         new_assets.add(self.process(asset, *args, **kwargs))
     return new_assets