[Python-modules-commits] [python-odf] 42/118: Moved odf2war to contrib Added -v to odfmeta
Wolfgang Borgert
debacle at moszumanska.debian.org
Fri Oct 3 21:27:20 UTC 2014
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to reference refs/remotes/upstream/master
in repository python-odf.
commit 2c51412e5a5cb4df22000cdcc32303446f715c73
Author: Søren Roug <soren.roug at eea.europa.eu>
Date: Sat Mar 7 21:23:40 2009 +0000
Moved odf2war to contrib
Added -v to odfmeta
---
{odf2war => contrib/odf2war}/Makefile | 0
{odf2war => contrib/odf2war}/odf2war | 0
{odf2war => contrib/odf2war}/odf2war.1 | 0
{odf2war => contrib/odf2war}/odf2war.xml | 0
odflint/odflint | 8 +++++---
odfmeta/odfmeta | 15 ++++++++++++---
odfmeta/odfmeta.1 | 15 ++++++++++-----
odfmeta/odfmeta.xml | 16 ++++++++++++++--
setup.py | 3 ---
9 files changed, 41 insertions(+), 16 deletions(-)
diff --git a/odf2war/Makefile b/contrib/odf2war/Makefile
similarity index 100%
rename from odf2war/Makefile
rename to contrib/odf2war/Makefile
diff --git a/odf2war/odf2war b/contrib/odf2war/odf2war
similarity index 100%
rename from odf2war/odf2war
rename to contrib/odf2war/odf2war
diff --git a/odf2war/odf2war.1 b/contrib/odf2war/odf2war.1
similarity index 100%
rename from odf2war/odf2war.1
rename to contrib/odf2war/odf2war.1
diff --git a/odf2war/odf2war.xml b/contrib/odf2war/odf2war.xml
similarity index 100%
rename from odf2war/odf2war.xml
rename to contrib/odf2war/odf2war.xml
diff --git a/odflint/odflint b/odflint/odflint
index 17727f6..25efa14 100755
--- a/odflint/odflint
+++ b/odflint/odflint
@@ -34,6 +34,11 @@ except ImportError:
extension_attributes = {
+ "OpenDocument 1.2" : {
+ (STYLENS,u'section-properties'): (
+ (STYLENS,u'editable'),
+ ),
+ },
"OpenOffice.org" : {
(METANS,u'template'): (
(XLINKNS,u'role'),
@@ -45,9 +50,6 @@ extension_attributes = {
(TEXTNS,u'enable-numbering'),
(STYLENS,u'join-border'),
),
- (STYLENS,u'section-properties'): (
- (STYLENS,u'editable'),
- ),
(STYLENS,u'table-cell-properties'): (
(STYLENS,u'writing-mode'),
),
diff --git a/odfmeta/odfmeta b/odfmeta/odfmeta
index facb677..2a8b789 100755
--- a/odfmeta/odfmeta
+++ b/odfmeta/odfmeta
@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-# Copyright (C) 2006 Søren Roug, European Environment Agency
+# Copyright (C) 2006-2009 Søren Roug, European Environment Agency
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
@@ -52,10 +52,11 @@ Xfields = []
addfields = {}
deletefields = {}
yieldfields = {}
+showversion = None
def exitwithusage(exitcode=2):
""" print out usage information """
- sys.stderr.write("Usage: %s [-cdl] [-xXaAI metafield]... [-o output] [inputfile]\n" % sys.argv[0])
+ sys.stderr.write("Usage: %s [-cdlv] [-xXaAI metafield]... [-o output] [inputfile]\n" % sys.argv[0])
sys.stderr.write("\tInputfile must be OpenDocument format\n")
sys.exit(exitcode)
@@ -92,6 +93,7 @@ class odfmetaparser(base):
then manipulate in memory.
Small issue: Reorders elements
"""
+ version = 'Unknown'
def __init__(self):
self._mimetype = ''
@@ -107,6 +109,11 @@ class odfmetaparser(base):
# location and not at the end
# if name == (METANS,u'template'):
# self._data = [attrs.get((XLINKNS,u'title'),'')]
+ if showversion and name == (OFFICENS,u'document-meta'):
+ if showversion == '-V':
+ print "version:%s" % attrs.get((OFFICENS,u'version'),'Unknown')
+ else:
+ print "%s" % attrs.get((OFFICENS,u'version'),'Unknown')
if name == (METANS,u'user-defined'):
field = attrs.get((METANS,u'name'))
if field in deletefields:
@@ -165,7 +172,7 @@ writemeta = False # Do we change any meta data?
usenormalize = False
try:
- opts, args = getopt.getopt(sys.argv[1:], "cdlI:A:a:o:x:X:")
+ opts, args = getopt.getopt(sys.argv[1:], "cdlvVI:A:a:o:x:X:")
except getopt.GetoptError:
exitwithusage()
@@ -193,6 +200,8 @@ for o, a in opts:
deletefields[(DCNS,u'date')] = True
if o == '-c':
usenormalize = True
+ if o in ('-v', '-V'):
+ showversion = o
if o == '-l':
Xfields = fields.values()
if o == "-x":
diff --git a/odfmeta/odfmeta.1 b/odfmeta/odfmeta.1
index 10c2573..4bef05c 100644
--- a/odfmeta/odfmeta.1
+++ b/odfmeta/odfmeta.1
@@ -1,12 +1,12 @@
.\" Title: odfmeta
.\" Author: S\(/oren Roug
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
-.\" Date: 01/04/2009
+.\" Date: 03/07/2009
.\" Manual: User commands
.\" Source: odfpy
.\" Language: English
.\"
-.TH "ODFMETA" "1" "01/04/2009" "odfpy" "User commands"
+.TH "ODFMETA" "1" "03/07/2009" "odfpy" "User commands"
.\" -----------------------------------------------------------------
.\" * (re)Define some macros
.\" -----------------------------------------------------------------
@@ -171,7 +171,7 @@ odfmeta \- List or change the metadata of an ODF file
.SH "Synopsis"
.fam C
.HP \w'\fBodfmeta\fR\ 'u
-\fBodfmeta\fR [\-l] [\-c] [\-d] [\-x\ \fImetafield\fR...] [\-X\ \fImetafield\fR...] [\-a\ \fImetafield\fR...] [\-A\ \fImetafield\fR...] [\-I\ \fImetafield\fR...] [\-o\ \fIpath\fR] \fIpath\fR
+\fBodfmeta\fR [\-l] [\-v] [\-V] [\-c] [\-d] [\-x\ \fImetafield\fR...] [\-X\ \fImetafield\fR...] [\-a\ \fImetafield\fR...] [\-A\ \fImetafield\fR...] [\-I\ \fImetafield\fR...] [\-o\ \fIpath\fR] \fIpath\fR
.fam
.SH "Description"
.PP
@@ -186,6 +186,12 @@ is a program that will list or change the metadata in an OpenDocument file\&. Th
List (extract) all known metadata fields\&.
.RE
.PP
+\-v or \-V
+.RS 4
+Print the version number of the ODF document
+\fIformat\fR\&. If you use \-V it will print "version:" before the number for compatibility with \-X\&. The version number can\'t be modified\&.
+.RE
+.PP
\-c
.RS 4
Make field values continous by normalizing white space\&. Might be convenient when postprocessing with standard (line oriented) text utilities\&.
@@ -241,7 +247,7 @@ option is provided, the ODT file will be written to stdout\&.
.BB lightgray adjust-for-leading-newline
.sp -1
-odfmeta \-l odf\-file
+odfmeta \-l odf\-file\&.odt
odfmeta \-I "title:The Little Engine That Could" \-A subject:I\-think\-I\-can \-o newfile\&.odt source\&.odt
.EB lightgray adjust-for-leading-newline
.if t \{\
@@ -256,7 +262,6 @@ odfmeta \-I "title:The Little Engine That Could" \-A subject:I\-think\-I\-can \-
.SH "See Also"
.PP
-\fBodftools\fR(1),
\fBformail\fR(1),
\fBid3tag\fR(1)
.SH "Todo"
diff --git a/odfmeta/odfmeta.xml b/odfmeta/odfmeta.xml
index a1ca6ee..573c2ef 100644
--- a/odfmeta/odfmeta.xml
+++ b/odfmeta/odfmeta.xml
@@ -23,6 +23,8 @@
<cmdsynopsis>
<command>odfmeta</command>
<arg>-l</arg>
+ <arg>-v</arg>
+ <arg>-V</arg>
<arg>-c</arg>
<arg>-d</arg>
<arg rep="repeat">-x <replaceable>metafield</replaceable></arg>
@@ -60,6 +62,17 @@ List (extract) all known metadata fields.
</varlistentry>
<varlistentry>
+<term>-v or -V</term>
+<listitem>
+<para>
+Print the version number of the ODF document <emphasis>format</emphasis>.
+If you use -V it will print "version:" before the number for compatibility with -X.
+The version number can't be modified.
+
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
<term>-c</term>
<listitem>
<para>
@@ -155,14 +168,13 @@ If no <option>-o</option> option is provided, the ODT file will be written to st
<refsect1><title>Examples</title>
<screen>
-odfmeta -l odf-file
+odfmeta -l odf-file.odt
odfmeta -I "title:The Little Engine That Could" -A subject:I-think-I-can -o newfile.odt source.odt
</screen>
</refsect1>
<refsect1><title>See Also</title>
<para>
-<command>odftools</command>(1),
<command>formail</command>(1),
<command>id3tag</command>(1)
</para>
diff --git a/setup.py b/setup.py
index be77677..97e8832 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,6 @@ if platform.system() in ('Linux','Unix'):
'mailodf/mailodf.1',
'odf2xhtml/odf2xhtml.1',
'odf2mht/odf2mht.1',
- 'odf2war/odf2war.1',
'odf2xml/odf2xml.1',
'odfimgimport/odfimgimport.1',
'odflint/odflint.1',
@@ -79,7 +78,6 @@ In addition to the API, there are a few scripts:
- mailodf - Email ODF file as HTML archive
- odf2xhtml - Convert ODF to (X)HTML
- odf2mht - Convert ODF to HTML archive
-- odf2war - Convert ODF to KDE web archive
- odf2xml - Create OpenDocument XML file from OD? package
- odfimgimport - Import external images
- odflint - Check ODF file for problems
@@ -99,7 +97,6 @@ Take also a look at the contrib folder."""
'mailodf/mailodf',
'odf2xhtml/odf2xhtml',
'odf2mht/odf2mht',
- 'odf2war/odf2war',
'odf2xml/odf2xml',
'odfimgimport/odfimgimport',
'odflint/odflint',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-odf.git
More information about the Python-modules-commits
mailing list