コード例 #1
0
ファイル: article.py プロジェクト: AaronMBrown/denigma
    def wordIt(self, input=None, output=None, close=False):
        """Creates a Word output document including emphasis.
        Note this is unfortunaly very slow."""
        if input:
            word = Word(input)
        else:
            word = Word()

        for figure in self.figures.values():
            figure.filename =  os.path.join(os.getcwd(), figure.filename).replace('\\', '/') #self.name[:-3]

        word.i(self.string)
        for figure in self.figures.values():
            try:
                word.insertImage(figure.filename)
            except Exception as e:
                print e
                pass

        for table in self.tables.values():
            if not table.raw:
                word.insertTable(table)