MCPcopy
hub / github.com/donnemartin/gitsome / load_urls

Method load_urls

gitsome/config.py:552–577  ·  view source on GitHub ↗

Load the current set of urls from ~/.gitsomeconfigurl. :type view_in_browser: bool :param view_in_browser: Determines whether to view the urls in a browser. :rtype: list :return: Collection of urls.

(self, view_in_browser)

Source from the content-addressed store, hash-verified

550 color_config=True)
551
552 def load_urls(self, view_in_browser):
553 """Load the current set of urls from ~/.gitsomeconfigurl.
554
555 :type view_in_browser: bool
556 :param view_in_browser: Determines whether to view the urls in a
557 browser.
558
559 :rtype: list
560 :return: Collection of urls.
561 """
562 config = self.get_github_config_path(self.CONFIG_URL)
563 parser = configparser.RawConfigParser()
564 with open(config) as config_file:
565 try:
566 parser.read_file(config_file)
567 except AttributeError:
568 parser.readfp(config_file)
569 urls = parser.get(self.CONFIG_URL_SECTION,
570 self.CONFIG_URL_LIST)
571 urls = urls.strip()
572 excludes = ['[', ']', "'"]
573 for exclude in excludes:
574 urls = urls.replace(exclude, '')
575 if not view_in_browser:
576 urls = urls.replace('https://github.com/', '')
577 return urls.split(', ')
578
579 def print_auth_error(self):
580 """Print a message the authorization has failed."""

Callers 2

viewMethod · 0.80
test_load_urlsMethod · 0.80

Calls 4

openFunction · 0.85
getMethod · 0.45
splitMethod · 0.45

Tested by 1

test_load_urlsMethod · 0.64