How to use the planet.opml.opml2config function in planet

To help you get started, we’ve selected a few planet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rubys / venus / tests / test_opml.py View on Github external
def test_outline_element(self):
        opml2config('''''', self.config)
        self.assertEqual('sample feed',
           self.config.get("http://example.com/feed.xml", 'name'))
github rubys / venus / tests / test_opml.py View on Github external
def test_wrong_type(self):
        opml2config('''''', self.config)
        self.assertFalse(self.config.has_section("http://example.com/feed.xml"))
github rubys / venus / tests / test_opml.py View on Github external
def test_blank_text_blank_title(self):
        opml2config('''''', self.config)
        self.assertFalse(self.config.has_section("http://example.com/feed.xml"))
github rubys / venus / tests / test_opml.py View on Github external
def test_blank_text_no_title(self):
        opml2config('''''', self.config)
        self.assertFalse(self.config.has_section("http://example.com/feed.xml"))
github rubys / venus / tests / test_opml.py View on Github external
def test_type_atom(self):
        opml2config('''''', self.config)
        self.assertEqual('sample feed',
           self.config.get("http://example.com/feed.xml", 'name'))
github rubys / venus / tests / test_opml.py View on Github external
def test_missing_xmlUrl(self):
        opml2config('''''', self.config)
        self.assertFalse(self.config.has_section("http://example.com/feed.xml"))
github rubys / venus / tests / test_opml.py View on Github external
def test_WordPress_link_manager(self):
        # http://www.wasab.dk/morten/blog/archives/2006/10/22/wp-venus
        opml2config('''''', self.config)
        self.assertEqual('sample feed',
           self.config.get("http://example.com/feed.xml", 'name'))
github rubys / venus / tests / test_opml.py View on Github external
def test_blank_text_with_title(self):
        opml2config('''''', self.config)
        self.assertEqual('sample feed',
           self.config.get("http://example.com/feed.xml", 'name'))
github ghoseb / planet.clojure / planet / config.py View on Github external
def data2config(data, cached_config):
            if content_type(list).find('opml')>=0:
                opml.opml2config(data, cached_config)
            elif content_type(list).find('foaf')>=0:
                foaf.foaf2config(data, cached_config)
            elif content_type(list).find('csv')>=0:
                csv_config.csv2config(data, cached_config)
            elif content_type(list).find('config')>=0:
                cached_config.readfp(data)
            else:
                from planet import shell
                import StringIO
                cached_config.readfp(StringIO.StringIO(shell.run(
                    content_type(list), data.getvalue(), mode="filter")))

            if cached_config.sections() in [[], [list]]: 
                raise Exception
github rubys / venus / planet / config.py View on Github external
def data2config(data, cached_config):
            if content_type(list).find('opml')>=0:
                opml.opml2config(data, cached_config)
            elif content_type(list).find('foaf')>=0:
                foaf.foaf2config(data, cached_config)
            elif content_type(list).find('csv')>=0:
                csv_config.csv2config(data, cached_config)
            elif content_type(list).find('config')>=0:
                cached_config.readfp(data)
            else:
                from planet import shell
                import StringIO
                cached_config.readfp(StringIO.StringIO(shell.run(
                    content_type(list), data.getvalue(), mode="filter")))

            if cached_config.sections() in [[], [list]]: 
                raise Exception