parameters: (self)
return_statement: return output
docstring: :raises:
              ProviderException: when an error occurs with the channel contents
              DownloaderException: when an error occurs trying to open a URL
  
          :return:
              A list of the repository URLs
docstring_summary: :raises:
              ProviderException: when an error occurs with the channel contents
              DownloaderException: when an error occurs trying to open a URL
docstring_tokens: : raises : ProviderException : when an error occurs with the channel contents DownloaderException : when an error occurs trying to open a URL
function: def get_repositories(self):
          """
          :raises:
              ProviderException: when an error occurs with the channel contents
              DownloaderException: when an error occurs trying to open a URL
  
          :return:
              A list of the repository URLs
          """
  
          self.fetch()
  
          if 'repositories' not in self.channel_info:
              raise ProviderException(u'Channel %s does not appear to be a valid channel file because the "repositories" JSON key is missing.' % self.channel)
  
          # Determine a relative root so repositories can be defined
          # relative to the location of the channel file.
          if re.match('https?://', self.channel, re.I):
              url_pieces = urlparse(self.channel)
              domain = url_pieces.scheme + '://' + url_pieces.netloc
              path = '/' if url_pieces.path == '' else url_pieces.path
              if path[-1] != '/':
                  path = os.path.dirname(path)
              relative_base = domain + path
          else:
              relative_base = os.path.dirname(self.channel) + '/'
  
          output = []
          repositories = self.channel_info.get('repositories', [])
          for repository in repositories:
              if re.match('^\./|\.\./', repository):
                  repository = os.path.normpath(relative_base + repository)
              output.append(repository)
  
          return output
function_tokens: def get_repositories ( self ) : self . fetch ( ) if 'repositories' not in self . channel_info : raise ProviderException ( u'Channel %s does not appear to be a valid channel file because the "repositories" JSON key is missing.' % self . channel ) # Determine a relative root so repositories can be defined # relative to the location of the channel file. if re . match ( 'https?://' , self . channel , re . I ) : url_pieces = urlparse ( self . channel ) domain = url_pieces . scheme + '://' + url_pieces . netloc path = '/' if url_pieces . path == '' else url_pieces . path if path [ - 1 ] != '/' : path = os . path . dirname ( path ) relative_base = domain + path else : relative_base = os . path . dirname ( self . channel ) + '/' output = [ ] repositories = self . channel_info . get ( 'repositories' , [ ] ) for repository in repositories : if re . match ( '^\./|\.\./' , repository ) : repository = os . path . normpath ( relative_base + repository ) output . append ( repository ) return output