/usr/share/pyshared/openoffice/__init__.py is in python-openoffice 1:0.1+20110209-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # -*- mode: python ; coding: utf-8 -*-
#
# Copyright (c) 2008 by Hartmut Goebel <h.goebel@goebel-consult.de>
# Licenced under the GNU General Public License v3 (GPLv3)
# see file LICENSE-gpl-3.0.txt
#
__author__ = "Hartmut Goebel <h.goebel@goebel-consult.de>"
__copyright__ = "Copyright (c) 2008 by Hartmut Goebel <h.goebel@goebel-consult.de>"
__licence__ = "GPLv3 - GNU General Public License v3"
import uno
from com.sun.star.beans import PropertyValue
def iter(elems, prefix=''):
# todo: getByIndex verwenden??
if hasattr(elems, 'createEnumeration'):
enumerator = elems.createEnumeration()
while enumerator.hasMoreElements():
yield enumerator.nextElement()
else:
for name in elems.ElementNames:
if name.startswith(prefix):
yield elems.getByName(name)
def Properties(**kw):
return tuple([PropertyValue(k, 0, v,0)
for k,v in kw.iteritems()])
|