def pull_external(ctx, filename):
 hashed_filename = hash_func(filename)
 rel_path = path.join('webassets-external', ('%s_%s' % (hashed_filename, path.basename(filename))))
 full_path = path.join(ctx.directory, rel_path)
 if path.isfile(full_path):
  gs = (lambda p: os.stat(p).st_mtime)
  if (gs(full_path) > gs(filename)):
   return full_path
 directory = path.dirname(full_path)
 if (not path.exists(directory)):
  os.makedirs(directory)
 FileHunk(filename).save(full_path)
 return full_path

def pull_external ( ctx , filename ) : hashed_filename = hash_func ( filename ) rel_path = path . join ( 'webassets-external' , ( '%s_%s' % ( hashed_filename , path . basename ( filename ) ) ) ) full_path = path . join ( ctx . directory , rel_path ) if path . isfile ( full_path ) : gs = ( lambda p : os . stat ( p ) . st_mtime ) if ( gs ( full_path ) > gs ( filename ) ) : return full_path directory = path . dirname ( full_path ) if ( not path . exists ( directory ) ) : os . makedirs ( directory ) FileHunk ( filename ) . save ( full_path ) return full_path
helper which will pull filename into :attr:environment .