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)
| 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.""" |