view OpmlImport.py @ 235:a34cb404cef3

remove the Ui_ prefix from the Qt designer files - The eric IDE will add it without any configuration. Rewrite the Makefile to behave as eric.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 26 Jan 2015 13:38:55 +0100
parents 699d8f1cebd4
children
line wrap: on
line source

# -*- coding: utf-8 -*-
from Feed import Feed
from xml.dom.minidom import parse

def createFeedsFromOPML(session=None, filename=None):
    document = parse(filename)
    outlines = document.getElementsByTagName("outline")
    for outline in outlines:
        url = outline.getAttribute("xmlUrl")
        title = outline.getAttribute("title")

        feed = Feed(title, url)
        session.add(feed)
    session.commit()