def sk1_saver(sk2_doc, filename=None, fileptr=None, translate=True, cnf=None, **kw): cnf = merge_cnf(cnf, kw) if sk2_doc.cid == uc2const.SK1: translate = False if translate: sk1_doc = SK1Presenter(sk2_doc.appdata, cnf) sk1_doc.translate_from_sk2(sk2_doc) sk1_doc.save(filename, fileptr) sk1_doc.close() else: sk2_doc.save(filename, fileptr)
def sk1_loader(appdata, filename=None, fileptr=None, translate=True, cnf=None, **kw): cnf = merge_cnf(cnf, kw) sk1_doc = SK1Presenter(appdata, cnf) sk1_doc.load(filename, fileptr) if translate: sk2_doc = SK2_Presenter(appdata, cnf) if filename: sk2_doc.doc_file = filename sk1_doc.translate_to_sk2(sk2_doc) sk1_doc.close() return sk2_doc return sk1_doc