parameters: (resource_id)
docstring: Constructs export URL for a given resource.
  
    Args:
      resource_id: str The document/item's resource id. Example presentation:
          'presentation%3A0A1234567890'.
  
    Raises:
      gdata.client.ValueError if the resource_id is not a valid format.
docstring_summary: Constructs export URL for a given resource.
docstring_tokens: Constructs export URL for a given resource .
function: def make_content_link_from_resource_id(resource_id):
    """Constructs export URL for a given resource.
  
    Args:
      resource_id: str The document/item's resource id. Example presentation:
          'presentation%3A0A1234567890'.
  
    Raises:
      gdata.client.ValueError if the resource_id is not a valid format.
    """
    match = RESOURCE_ID_PATTERN.match(resource_id)
  
    if match:
      label = match.group(1)
      doc_id = match.group(3)
      if label == DOCUMENT_LABEL:
        return '/feeds/download/documents/Export?docId=%s' % doc_id
      if label == PRESENTATION_LABEL:
        return '/feeds/download/presentations/Export?docId=%s' % doc_id
      if label == SPREADSHEET_LABEL:
        return ('http://spreadsheets.google.com/feeds/download/spreadsheets/'
                'Export?key=%s' % doc_id)
    raise ValueError, ('Invalid resource id: %s, or manually creating the '
                       'download url for this type of doc is not possible'
                       % resource_id)
function_tokens: def make_content_link_from_resource_id ( resource_id ) : match = RESOURCE_ID_PATTERN . match ( resource_id ) if match : label = match . group ( 1 ) doc_id = match . group ( 3 ) if label == DOCUMENT_LABEL : return '/feeds/download/documents/Export?docId=%s' % doc_id if label == PRESENTATION_LABEL : return '/feeds/download/presentations/Export?docId=%s' % doc_id if label == SPREADSHEET_LABEL : return ( 'http://spreadsheets.google.com/feeds/download/spreadsheets/' 'Export?key=%s' % doc_id ) raise ValueError , ( 'Invalid resource id: %s, or manually creating the ' 'download url for this type of doc is not possible' % resource_id )