/usr/share/pyshared/openoffice/streams.py is in python-openoffice 1:0.1+20110209-1build1.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #!/usr/bin/env 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
import unohelper
from com.sun.star.io import XInputStream, XOutputStream, XSeekable
class InputStream(unohelper.Base, XInputStream, XSeekable):
def __init__(self, stream):
self.f = stream
def skipBytes(self, count):
self.f.read(count)
def readBytes(self, retSeq, count):
s = self.f.read(count)
return len(s), uno.ByteSequence(s)
def readSomeBytes(self, retSeq , count):
return self.readBytes(retSeq, count)
def available(self):
return 0
def closeInput(self):
self.f.close()
def seek(self, pos):
self.f.seek(pos)
def getPosition(self):
return self.f.tell()
def getLength(self):
f = self.f # shortcut
pos = f.tell()
f.seek(0, 2)
len = f.tell()
f.seek(pos)
return len
class OutputStream(unohelper.Base, XOutputStream):
def __init__(self, stream):
self.f = stream
def writeBytes(self, seq):
self.f.write(seq.value)
def closeOutput(self):
self.f.flush()
def flush(self):
self.f.flush()
|