def aco_loader(appdata,
               filename=None,
               fileptr=None,
               translate=True,
               convert=False,
               cnf=None,
               **kw):
    cnf = merge_cnf(cnf, kw)
    doc = ACO_Presenter(appdata, cnf)
    doc.load(filename, fileptr)
    if convert:
        skp_doc = SKP_Presenter(appdata, cnf)
        doc.convert_to_skp(skp_doc)
        doc.close()
        return skp_doc
    return doc
Beispiel #2
0
def aco_loader(appdata,
               filename=None,
               fileptr=None,
               translate=True,
               convert=False,
               cnf={},
               **kw):
    if kw: cnf.update(kw)
    doc = ACO_Presenter(appdata, cnf)
    doc.load(filename, fileptr)
    if convert:
        skp_doc = SKP_Presenter(appdata, cnf)
        doc.convert_to_skp(skp_doc)
        doc.close()
        return skp_doc
    if translate:
        skp_doc = SKP_Presenter(appdata, cnf)
        doc.convert_to_skp(skp_doc)
        sk2_doc = SK2_Presenter(appdata, cnf)
        skp_doc.translate_to_sk2(sk2_doc)
        doc.close()
        skp_doc.close()
        return sk2_doc
    return doc