def download_workflow(url):
 filename = url.split(u'/')[(-1)]
 if ((not url.endswith(u'.alfredworkflow')) or (not filename.endswith(u'.alfredworkflow'))):
  raise ValueError(u'Attachment `{0}` not a workflow'.format(filename))
 local_path = os.path.join(tempfile.gettempdir(), filename)
 wf().logger.debug(u'Downloading updated workflow from `{0}` to `{1}` ...'.format(url, local_path))
 response = web.get(url)
 with open(local_path, u'wb') as output:
  output.write(response.content)
 return local_path

def download_workflow ( url ) : filename = url . split ( u'/' ) [ ( - 1 ) ] if ( ( not url . endswith ( u'.alfredworkflow' ) ) or ( not filename . endswith ( u'.alfredworkflow' ) ) ) : raise ValueError ( u'Attachment `{0}` not a workflow' . format ( filename ) ) local_path = os . path . join ( tempfile . gettempdir ( ) , filename ) wf ( ) . logger . debug ( u'Downloading updated workflow from `{0}` to `{1}` ...' . format ( url , local_path ) ) response = web . get ( url ) with open ( local_path , u'wb' ) as output : output . write ( response . content ) return local_path
download workflow at url to a local temporary file .