Example #1
0
def cpl_saver(doc,
              filename=None,
              fileptr=None,
              translate=True,
              convert=False,
              cnf=None,
              **kw):
    cnf = merge_cnf(cnf, kw)
    appdata = doc.appdata
    if convert:
        cpl_doc = CPL_Presenter(appdata, cnf)
        cpl_doc.convert_from_skp(doc)
        cpl_doc.save(filename, fileptr)
        cpl_doc.close()
    else:
        doc.save(filename, fileptr)
Example #2
0
def cpl_saver(doc, filename=None, fileptr=None, translate=True,
			convert=False, cnf={}, **kw):
	if kw: cnf.update(kw)
	appdata = doc.appdata
	if translate:
		skp_doc = SKP_Presenter(appdata, cnf)
		skp_doc.translate_from_sk2(doc)
		cpl_doc = CPL_Presenter(appdata, cnf)
		cpl_doc.convert_from_skp(skp_doc)
		cpl_doc.save(filename, fileptr)
		cpl_doc.close()
		skp_doc.close()
	elif convert:
		cpl_doc = CPL_Presenter(appdata, cnf)
		cpl_doc.convert_from_skp(doc)
		cpl_doc.save(filename, fileptr)
		cpl_doc.close()
	else:
		doc.save(filename, fileptr)
Example #3
0
def cpl_saver(doc,
              filename=None,
              fileptr=None,
              translate=True,
              convert=False,
              cnf={},
              **kw):
    if kw: cnf.update(kw)
    appdata = doc.appdata
    if translate:
        skp_doc = SKP_Presenter(appdata, cnf)
        skp_doc.translate_from_sk2(doc)
        cpl_doc = CPL_Presenter(appdata, cnf)
        cpl_doc.convert_from_skp(skp_doc)
        cpl_doc.save(filename, fileptr)
        cpl_doc.close()
        skp_doc.close()
    elif convert:
        cpl_doc = CPL_Presenter(appdata, cnf)
        cpl_doc.convert_from_skp(doc)
        cpl_doc.save(filename, fileptr)
        cpl_doc.close()
    else:
        doc.save(filename, fileptr)