Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Get the IFID from a story file or from an ifiction
file.

        def get_ifids(story_file):
    """Get the IFID from a story file or from an ifiction
    file.
    """

    try:
        xml_doc = xml.dom.minidom.parse(story_file)
    except:
        story_data = _get_story_data(story_file) 
        if blorb.claim_story_file(story_data):
            return blorb.get_story_file_ifid(story_data)
        else:
            handler = deduce_handler(story_file, story_data)
            return [handler.get_story_file_ifid(story_data)]
    else:
        if not ifiction.is_ifiction(xml_doc):
            return None
        ifids = []
        stories = ifiction.get_all_stories(xml_doc)
        for story in stories:
            ifids.append(ifiction.get_identification(story)["ifid"])
        return ifids
        


src/p/y/pyifbabel-0.2.3/treatyofbabel/ifstory.py   pyifbabel(Download)
            return
        self.format = babel.deduce_format(self.story_file)
        for ifid in babel.get_ifids(self.story_file):
            if ifid not in self.ifid_list:
                self.ifid_list.append(ifid)