Bug in file URL when connecting to OO in server mode on some installations.
This commit is contained in:
parent
f9966a9654
commit
280c5fe0c0
|
@ -61,11 +61,11 @@ class Converter:
|
||||||
self.oo = None # OpenOffice application object
|
self.oo = None # OpenOffice application object
|
||||||
self.doc = None # OpenOffice loaded document
|
self.doc = None # OpenOffice loaded document
|
||||||
def getDocUrl(self, docPath):
|
def getDocUrl(self, docPath):
|
||||||
|
import uno
|
||||||
if not os.path.exists(docPath) and not os.path.isfile(docPath):
|
if not os.path.exists(docPath) and not os.path.isfile(docPath):
|
||||||
raise ConverterError(DOC_NOT_FOUND % docPath)
|
raise ConverterError(DOC_NOT_FOUND % docPath)
|
||||||
docAbsPath = os.path.abspath(docPath)
|
docAbsPath = os.path.abspath(docPath)
|
||||||
docUrl = 'file:///' + docAbsPath.replace('\\', '/')
|
return uno.systemPathToFileUrl(docAbsPath)
|
||||||
return docUrl
|
|
||||||
def getResultFilter(self, resultType):
|
def getResultFilter(self, resultType):
|
||||||
if ODT_FILE_TYPES.has_key(resultType):
|
if ODT_FILE_TYPES.has_key(resultType):
|
||||||
res = ODT_FILE_TYPES[resultType]
|
res = ODT_FILE_TYPES[resultType]
|
||||||
|
@ -79,7 +79,7 @@ class Converter:
|
||||||
res = '%s.%s' % (baseName, resultType)
|
res = '%s.%s' % (baseName, resultType)
|
||||||
else:
|
else:
|
||||||
res = '%s.res.%s' % (baseName, resultType)
|
res = '%s.res.%s' % (baseName, resultType)
|
||||||
fileName = res[8:]
|
fileName = res[7:]
|
||||||
try:
|
try:
|
||||||
f = open(fileName, 'w')
|
f = open(fileName, 'w')
|
||||||
f.write('Hello')
|
f.write('Hello')
|
||||||
|
|
Loading…
Reference in a new issue