예제 #1
0
    def exportHtmlNavSingle(self,
                            filePath,
                            includeRoot=True,
                            openOnly=False,
                            addHeader=False,
                            navPaneLevels=1):
        """Export selected branches to single-page HTML with a navigation pane.

        Return True on successful export.
        Arguments:
            filePath -- the path and filename to export to
            includeRoot -- if True, include the root of the selection
            openOnly -- if True, do not include collapsed nodes
            addHeader -- if True, include the print header in the export
            numColumns -- the number of columns in the exported page
        """
        exports.ExportDialog.includeRoot = includeRoot
        exports.ExportDialog.openOnly = openOnly
        exports.ExportDialog.addHeader = addHeader
        exports.ExportDialog.navPaneLevels = navPaneLevels
        exports.ExportDialog.exportWhat = exports.ExportDialog.selectBranch
        localControl = globalref.mainControl.activeControl
        exportControl = exports.ExportControl(
            localControl.model.root,
            localControl.currentSelectionModel().selectedNodes(),
            globalref.mainControl.defaultFilePath())
        try:
            return exportControl.exportHtmlNavSingle(filePath)
        except IOError:
            return False
예제 #2
0
    def exportHtmlPages(self, filePath):
        """Export selected branches to multiple web pages with navigation pane.

        Return True on successful export.
        Arguments:
            filePath -- the directory path to export to
        """
        exports.ExportDialog.exportWhat = exports.ExportDialog.selectBranch
        localControl = globalref.mainControl.activeControl
        exportControl = exports.ExportControl(
            localControl.model.root,
            localControl.currentSelectionModel().selectedNodes(),
            globalref.mainControl.defaultFilePath())
        try:
            return exportControl.exportHtmlPages(filePath)
        except IOError:
            return False
예제 #3
0
    def exportBookmarksXbel(self, filePath):
        """Export selected branches to XBEL format bookmarks.

        Return True on successful export.
        Arguments:
            filePath -- the path and filename to export to
        """
        exports.ExportDialog.exportWhat = exports.ExportDialog.selectBranch
        localControl = globalref.mainControl.activeControl
        exportControl = exports.ExportControl(
            localControl.model.root,
            localControl.currentSelectionModel().selectedNodes(),
            globalref.mainControl.defaultFilePath())
        try:
            return exportControl.exportBookmarksXbel(filePath)
        except IOError:
            return False
예제 #4
0
    def exportTextTables(self, filePath):
        """Export the children of the selection to a tab delimited text table.

        Return True on successful export.
        Arguments:
            filePath -- the path and filename to export to
        """
        exports.ExportDialog.exportWhat = exports.ExportDialog.selectBranch
        localControl = globalref.mainControl.activeControl
        exportControl = exports.ExportControl(
            localControl.model.root,
            localControl.currentSelectionModel().selectedNodes(),
            globalref.mainControl.defaultFilePath())
        try:
            return exportControl.exportTextTables(filePath)
        except IOError:
            return False
예제 #5
0
    def exportHtmlTables(self, filePath, addHeader=False):
        """Export selected branches to multiple web page tables.

        Return True on successful export.
        Arguments:
            filePath -- the directory path to export to
            addHeader -- if True, include the print header in the export
        """
        exports.ExportDialog.addHeader = addHeader
        exports.ExportDialog.exportWhat = exports.ExportDialog.selectBranch
        localControl = globalref.mainControl.activeControl
        exportControl = exports.ExportControl(
            localControl.model.root,
            localControl.currentSelectionModel().selectedNodes(),
            globalref.mainControl.defaultFilePath())
        try:
            return exportControl.exportHtmlTables(filePath)
        except IOError:
            return False
예제 #6
0
    def exportTextPlain(self, filePath, includeRoot=True, openOnly=False):
        """Export selected branches to unformatted output text.

        Return True on successful export.
        Arguments:
            filePath -- the path and filename to export to
            includeRoot -- if True, include the root of the selection
            openOnly -- if True, do not include collapsed nodes
        """
        exports.ExportDialog.includeRoot = includeRoot
        exports.ExportDialog.openOnly = openOnly
        exports.ExportDialog.exportWhat = exports.ExportDialog.selectBranch
        localControl = globalref.mainControl.activeControl
        exportControl = exports.ExportControl(
            localControl.model.root,
            localControl.currentSelectionModel().selectedNodes(),
            globalref.mainControl.defaultFilePath())
        try:
            return exportControl.exportTextPlain(filePath)
        except IOError:
            return False