Hello community, here is the log from the commit of package libreoffice-converter for openSUSE:11.3 checked in at Thu Mar 31 01:47:17 CEST 2011.
-------- New Changes file: --- /dev/null 2010-08-26 16:28:41.000000000 +0200 +++ 11.3/libreoffice-converter/libreoffice-converter.changes 2011-03-18 22:33:58.000000000 +0100 @@ -0,0 +1,63 @@ +------------------------------------------------------------------- +Fri Mar 18 22:12:32 CET 2011 - [email protected] + +- maintenance update (bnc#667421, MaintenanceTracker-38738) + +------------------------------------------------------------------- +Tue Mar 1 12:32:14 CET 2011 - [email protected] + +- mention loconvert instead of ooconvert in the help message (bnc#675868) + +------------------------------------------------------------------- +Mon Feb 21 17:47:27 CET 2011 - [email protected] + +- avoided error messages when the soffice.bin process is stopped + +------------------------------------------------------------------- +Thu Feb 17 20:23:17 CET 2011 - [email protected] + +- bumped version to 3.3; made sure that it was considered as + a replacement of the older package + +------------------------------------------------------------------- +Fri Feb 4 21:01:38 CET 2011 - [email protected] + +- fixed error message about existing output file +- made sure that soffice.bin was closed at the end + +------------------------------------------------------------------- +Thu Feb 3 17:32:37 CET 2011 - [email protected] + +- renamed from OpenOffice_org-converter to libreoffice-converter +- installed the python part into /usr/share/libreoffice +- renamed the wrapper to loconvert +- added compat symlink ooconvert +- updated the wrapper to work with both OOo and LO + +------------------------------------------------------------------- +Mon Apr 12 16:47:48 CEST 2010 - [email protected] + +- fixed name of the XLSX file type (bnc#590691) +- fixed DOTX file suffix in the man page + +------------------------------------------------------------------- +Thu Apr 23 19:13:22 CEST 2009 - [email protected] + +- moved DocumentConverter.py from the basis3.0 dir to avoid dependency + on the minor OOo version; works with OOo-3.1 now + +------------------------------------------------------------------- +Mon Feb 9 16:53:11 CET 2009 - [email protected] + +- defined filters for OOo-1.x file formats +- defined filters for templates of the already supported formats +- added check for already existing output file +- added --force option +- added manual page and better help +- fixed to work with filenames with space + +------------------------------------------------------------------- +Thu Sep 11 21:34:53 CEST 2008 - [email protected] + +- package created, version 3.0 (fate#304874) + calling whatdependson for 11.3-i586 New: ---- DocumentConverter.py DocumentConverter.py-more-types.diff libreoffice-converter.changes libreoffice-converter.spec loconvert loconvert.1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libreoffice-converter.spec ++++++ # # spec file for package libreoffice-converter # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: libreoffice-converter %define ooo_home libreoffice Version: 3.3 Release: 2.<RELEASE2> License: LGPLv2.1+ Group: Productivity/Office/Other AutoReqProv: on Requires: libreoffice-pyuno >= 2.99 # compat stuff Provides: OpenOffice_org-converter = %version Obsoletes: OpenOffice_org-converter <= %version Summary: Commandline Document Converter Using LibreOffice Url: http://www.artofsolving.com/files/DocumentConverter.py Source0: DocumentConverter.py Source1: loconvert Source2: loconvert.1 Patch0: DocumentConverter.py-more-types.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %description This package includes a simple script ooconvert that can be used to convert various document file formats on the commandline. It uses OpenOffice.org that guarantees the quality and the variety of available document file formats. %prep %setup -c -T cp %{S:0} %{S:1} %{S:2} . %patch0 %build %install install -m 755 -d $RPM_BUILD_ROOT%_datadir/%ooo_home/program install -m 755 -d $RPM_BUILD_ROOT%_bindir install -m 755 -d $RPM_BUILD_ROOT%_mandir/man1 install -m 644 DocumentConverter.py $RPM_BUILD_ROOT%_datadir/%ooo_home/program install -m 755 loconvert $RPM_BUILD_ROOT%_bindir install -m 644 loconvert.1 $RPM_BUILD_ROOT%_mandir/man1 # compat stuff ln -sf loconvert $RPM_BUILD_ROOT%_bindir/ooconvert echo ".so man1/loconvert.1" >| $RPM_BUILD_ROOT%_mandir/man1/ooconvert.1 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %dir %_datadir/%ooo_home %dir %_datadir/%ooo_home/program %_datadir/%ooo_home/program/* %_bindir/* %_mandir/man1/* %changelog ++++++ DocumentConverter.py ++++++ # # PyODConverter (Python OpenDocument Converter) v1.0.0 - 2008-05-05 # # This script converts a document from one office format to another by # connecting to an LibreOffice instance via Python-UNO bridge. # # Copyright (C) 2008 Mirko Nasato <[email protected]> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl-2.1.html # - or any later version. # DEFAULT_OPENOFFICE_PORT = 8100 import uno from os.path import abspath, isfile, splitext from com.sun.star.beans import PropertyValue from com.sun.star.task import ErrorCodeIOException from com.sun.star.connection import NoConnectException FAMILY_TEXT = "Text" FAMILY_SPREADSHEET = "Spreadsheet" FAMILY_PRESENTATION = "Presentation" FAMILY_DRAWING = "Drawing" FILTER_MAP = { "pdf": { FAMILY_TEXT: "writer_pdf_Export", FAMILY_SPREADSHEET: "calc_pdf_Export", FAMILY_PRESENTATION: "impress_pdf_Export", FAMILY_DRAWING: "draw_pdf_Export" }, "html": { FAMILY_TEXT: "HTML (StarWriter)", FAMILY_SPREADSHEET: "HTML (StarCalc)", FAMILY_PRESENTATION: "impress_html_Export" }, "odt": { FAMILY_TEXT: "writer8" }, "doc": { FAMILY_TEXT: "MS Word 97" }, "rtf": { FAMILY_TEXT: "Rich Text Format" }, "txt": { FAMILY_TEXT: "Text" }, "ods": { FAMILY_SPREADSHEET: "calc8" }, "xls": { FAMILY_SPREADSHEET: "MS Excel 97" }, "odp": { FAMILY_PRESENTATION: "impress8" }, "ppt": { FAMILY_PRESENTATION: "MS PowerPoint 97" }, "swf": { FAMILY_PRESENTATION: "impress_flash_Export" } } # see http://wiki.services.openoffice.org/wiki/Framework/Article/Filter # for more available filters class DocumentConversionException(Exception): def __init__(self, message): self.message = message def __str__(self): return self.message class DocumentConverter: def __init__(self, port=DEFAULT_OPENOFFICE_PORT): localContext = uno.getComponentContext() resolver = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", localContext) try: context = resolver.resolve("uno:socket,host=localhost,port=%s;urp;StarOffice.ComponentContext" % port) except NoConnectException: raise DocumentConversionException, "failed to connect to OpenOffice.org on port %s" % port self.desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context) def convert(self, inputFile, outputFile): inputUrl = self._toFileUrl(inputFile) outputUrl = self._toFileUrl(outputFile) document = self.desktop.loadComponentFromURL(inputUrl, "_blank", 0, self._toProperties(Hidden=True)) try: document.refresh() except AttributeError: pass outputExt = self._getFileExt(outputFile) filterName = self._filterName(document, outputExt) try: document.storeToURL(outputUrl, self._toProperties(FilterName=filterName)) finally: document.close(True) def _filterName(self, document, outputExt): family = self._detectFamily(document) try: filterByFamily = FILTER_MAP[outputExt] except KeyError: raise DocumentConversionException, "unknown output format: '%s'" % outputExt try: return filterByFamily[family] except KeyError: raise DocumentConversionException, "unsupported conversion: from '%s' to '%s'" % (family, outputExt) def _detectFamily(self, document): if document.supportsService("com.sun.star.text.GenericTextDocument"): # NOTE: a GenericTextDocument is either a TextDocument, a WebDocument, or a GlobalDocument # but this further distinction doesn't seem to matter for conversions return FAMILY_TEXT if document.supportsService("com.sun.star.sheet.SpreadsheetDocument"): return FAMILY_SPREADSHEET if document.supportsService("com.sun.star.presentation.PresentationDocument"): return FAMILY_PRESENTATION if document.supportsService("com.sun.star.drawing.DrawingDocument"): return FAMILY_DRAWING raise DocumentConversionException, "unknown document family: %s" % document def _getFileExt(self, path): ext = splitext(path)[1] if ext is not None: return ext[1:].lower() def _toFileUrl(self, path): return uno.systemPathToFileUrl(abspath(path)) def _toProperties(self, **args): props = [] for key in args: prop = PropertyValue() prop.Name = key prop.Value = args[key] props.append(prop) return tuple(props) if __name__ == "__main__": from sys import argv, exit if len(argv) < 3: print "USAGE: python %s <input-file> <output-file>" % argv[0] exit(255) if not isfile(argv[1]): print "no such input file: %s" % argv[1] exit(1) try: converter = DocumentConverter() converter.convert(argv[1], argv[2]) except DocumentConversionException, exception: print "ERROR!" + str(exception) exit(1) except ErrorCodeIOException, exception: print "ERROR! ErrorCodeIOException %d" % exception.ErrCode exit(1) ++++++ DocumentConverter.py-more-types.diff ++++++ --- DocumentConverter.py +++ DocumentConverter.py @@ -34,13 +34,31 @@ FAMILY_PRESENTATION: "impress_html_Export" }, "odt": { FAMILY_TEXT: "writer8" }, + "ott": { FAMILY_TEXT: "writer8_template" }, + "sxw": { FAMILY_TEXT: "StarOffice XML (Writer)" }, + "stw": { FAMILY_TEXT: "writer_StarOffice_XML_Writer_Template" }, "doc": { FAMILY_TEXT: "MS Word 97" }, + "dot": { FAMILY_TEXT: "MS Word 97 Vorlage" }, + "docx": { FAMILY_TEXT: "MS Word 2007 XML" }, + "dotx": { FAMILY_TEXT: "MS Word 2007 XML Template" }, "rtf": { FAMILY_TEXT: "Rich Text Format" }, "txt": { FAMILY_TEXT: "Text" }, "ods": { FAMILY_SPREADSHEET: "calc8" }, + "ots": { FAMILY_SPREADSHEET: "calc8_template" }, + "sxc": { FAMILY_SPREADSHEET: "StarOffice XML (Calc)" }, + "stc": { FAMILY_SPREADSHEET: "calc_StarOffice_XML_Calc_Template" }, "xls": { FAMILY_SPREADSHEET: "MS Excel 97" }, + "xlt": { FAMILY_SPREADSHEET: "MS Excel 97 Vorlage/Template" }, + "xlsx": { FAMILY_SPREADSHEET: "Calc MS Excel 2007 XML" }, + "xltx": { FAMILY_SPREADSHEET: "Calc MS Excel 2007 XML Template" }, "odp": { FAMILY_PRESENTATION: "impress8" }, + "otp": { FAMILY_PRESENTATION: "impress8_template" }, + "sxi": { FAMILY_PRESENTATION: "StarOffice XML (Impress)" }, + "sti": { FAMILY_PRESENTATION: "impress_StarOffice_XML_Impress_Template" }, "ppt": { FAMILY_PRESENTATION: "MS PowerPoint 97" }, + "pot": { FAMILY_PRESENTATION: "MS PowerPoint 97 Vorlage" }, + "pptx": { FAMILY_PRESENTATION: "Impress MS PowerPoint 2007 XML" }, + "potx": { FAMILY_PRESENTATION: "Impress MS PowerPoint 2007 XML Template" }, "swf": { FAMILY_PRESENTATION: "impress_flash_Export" } } # see http://wiki.services.openoffice.org/wiki/Framework/Article/Filter ++++++ loconvert ++++++ #! /bin/bash # This script converts a document from one office format to another by # connecting to an LibreOffice instance via Python-UNO bridge. # # Uses DocumentConverter.py from http://www.artofsolving.com/files/DocumentConverter.py # # Copyright (C) 1996-2008 SUSE Linux Products GmbH, Nuernberg, Germany. # # Author: Jan Holesovsky <[email protected]>, 2008 # Petr Mladek <[email protected]>, 2008, 2011 # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl-2.1.html # - or any later version. document_converter_py=/usr/share/libreoffice/program/DocumentConverter.py function usage() { cat << EOF Converts the input file to the output file using LibreOffice. Usage: ${0##*/} [--help] [--force] input output Options: input - input file output - output file --help - print this help and exit --force - force an already existing output file to be replaced See "man loconvert" for more details. EOF } OOCONV_INPUT= OOCONV_OUTPUT= OOCONV_FORCE= while test ${#} -gt 0 ; do case "$1" in "--help") usage exit 1 ;; "--force") OOCONV_FORCE=1 ;; *) if test -n "$OOCONV_OUTPUT" ; then echo "Error: Too many argumetns!" exit 1; fi if test -z "$OOCONV_INPUT" ; then OOCONV_INPUT="$1" else OOCONV_OUTPUT="$1" fi ;; esac shift done if test -z "$OOCONV_INPUT" ; then echo "Error: Input file is not defined." exit 1; fi if test -z "$OOCONV_OUTPUT" ; then echo "Error: Output file is not defined." exit 1; fi if test ! -f "$OOCONV_INPUT" ; then echo "Error: The input file does not exist: $OOCONV_INPUT" exit 1; fi if test -f "$OOCONV_OUTPUT" -a -z "$OOCONV_FORCE" ; then echo "Error: The out file already exists: $OOCONV_OUTPUT" echo "You might use the option \"--force\"" exit 1; fi # detect the OOo installation ooo_home= soffice=`which soffice 2>/dev/null` if test -L $soffice ; then soffice_path=`readlink $soffice` ooo_home=`dirname $soffice_path`/.. fi # try some fallbacks if test -z "$ooo_home" ; then for dir in /usr/lib64/libreoffice \ /usr/lib/libreoffice \ /usr/lib64/ooo3 \ /usr/lib/ooo3 ; do test -f "$dir/program/soffice" && ooo_home="$dir" && continue done fi if test -z "$ooo_home" ; then echo "Error: Unable to find LibreOffice instalation" exit 1; fi # start the OOo echo "Starting LibreOffice..." RUNNING=`ps | grep soffice.bin | grep -v grep` [ -z "$RUNNING" ] || { echo "OOo is running, please close it first" ; exit 1 ; } $ooo_home/program/soffice -accept="socket,port=8100;urp;" -norestore -nofirststartwizard -nologo -headless >/dev/null 2>&1 & sleep 10 # run the tests echo "Doing the conversion..." export PYTHONPATH="$ooo_home/basis-link/program" python $document_converter_py "$OOCONV_INPUT" "$OOCONV_OUTPUT" # kill the OOo killall -9 soffice.bin ++++++ loconvert.1 ++++++ .TH loconvert "1" "2009-02-09" "LibreOffice Converter" "User Commands" .SH "Name" loconvert \- Commandline Document Converter Using LibreOffice .SH SYNOPSIS .B loconvert [\fB\-\-help\fR] [\fB\-\-force\fR] \fIinput\fR \fIoutput\fR .SH DESCRIPTION This tool converts documents between various formats on the commandline. It uses LibreOffice that guarantees the quality of available import and export filters. This tool tries to start LibreOffice in the server mode on backgroud. It does not work if the LibreOffice application has already been running. Also it slows down the conversion a lot. We hope to reduce these limitations in the further versions. .SH OPTIONS .TP \fIinput\fR Input file. The filename suffix must be one of the currently supported file formats, see below. .TP \fIoutput\fR Output file. The filename suffix defines the output file format. It must be one from the table below. An existing file can be overwritten by the \fB\-\-force\fR option. .TP \fB\-\-help\fR Print help and exit. .TP \fB\-\-force\fR Force an already existing output file to be replaced. .SH SUPPORTED FILE FORMATS The current version of this tool does not read the list of available input and output filters directly from LibreOffice. The list of supported file formats is hardcoded and thus limited to: .TP \fIdoc\fR Microsoft Word 97/2000/XP .TP \fIdocx\fR MS Word 2007 XML .TP \fIdot\fR Microsoft Word 97/2000/XP Template .TP \fIdotx\fR MS Word 2007 XML Template .TP \fIhtml\fR HyperText Markup Language (Web Page) .TP \fIodt\fR ODF Text Document .TP \fIods\fR ODF Spreadsheet .TP \fIodp\fR ODF Presentation .TP \fIott\fR ODF Text Document Template .TP \fIots\fR ODF Spreadsheet Template .TP \fIotp\fR ODF Presentation Template .TP \fIpdf\fR Portable Document Format .TP \fIppt\fR Microsoft PowerPoint 97/2000/XP .TP \fIpptx\fR Microsoft PowerPoint 2007 XML .TP \fIpot\fR Microsoft PowerPoint 97/2000/XP Template .TP \fIpotx\fR Microsoft PowerPoint 2007 XML Template .TP \fIrtf\fR Rich Text Format .TP \fIstc\fR OpenOffice.org 1.0 Spreadsheet Template .TP \fIsti\fR OpenOffice.org 1.0 Presentation Template .TP \fIstw\fR OpenOffice.org 1.0 Text Document Template .TP \fIsxc\fR OpenOffice.org 1.0 Spreadsheet .TP \fIsxi\fR OpenOffice.org 1.0 Presentation .TP \fIsxw\fR OpenOffice.org 1.0 Text Document .TP \fIswf\fR Macromedia Flash .TP \fItxt\fR Plain Text .TP \fIxls\fR Microsoft Excel 97/2000/XP .TP \fIxlsx\fR Microsoft Excel 2007 XML .TP \fIxlt\fR Microsoft Excel 97/2000/XP Template .TP \fIxltx\fR Microsoft Excel 2007 XML Template .SH TROUBLESHOOTING PROBLEMS See \fBhttp://en.opensuse.org/openSUSE:Bugreport_LO\fR for more details about how to report bugs in LibreOffice. .SH AUTHOR This manual page was created by Petr Mladek <[email protected]>. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
