Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
cloudooo
Commits
a962f44f
Commit
a962f44f
authored
Feb 14, 2017
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x2t: x2t dependencies in ooo handler removed
parent
a7007bd4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
35 deletions
+0
-35
cloudooo/handler/ooo/handler.py
cloudooo/handler/ooo/handler.py
+0
-26
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+0
-9
No files found.
cloudooo/handler/ooo/handler.py
View file @
a962f44f
...
@@ -43,12 +43,6 @@ from cloudooo.handler.ooo.monitor import monitor_sleeping_time
...
@@ -43,12 +43,6 @@ from cloudooo.handler.ooo.monitor import monitor_sleeping_time
from
cloudooo.util
import
logger
,
parseContentType
from
cloudooo.util
import
logger
,
parseContentType
from
psutil
import
pid_exists
from
psutil
import
pid_exists
try
:
from
cloudooo.handler.x2t.handler
import
Handler
as
YformatHandler
from
cloudooo.handler.x2t.handler
import
yformat_map
except
ImportError
:
yformat_map
=
None
class
Handler
(
object
):
class
Handler
(
object
):
"""OOO Handler is used to access the one Document and OpenOffice.
"""OOO Handler is used to access the one Document and OpenOffice.
For each Document inputed is created on instance of this class to manipulate
For each Document inputed is created on instance of this class to manipulate
...
@@ -59,13 +53,6 @@ class Handler(object):
...
@@ -59,13 +53,6 @@ class Handler(object):
def
__init__
(
self
,
base_folder_url
,
data
,
source_format
,
**
kw
):
def
__init__
(
self
,
base_folder_url
,
data
,
source_format
,
**
kw
):
"""Creates document in file system and loads it in OOo."""
"""Creates document in file system and loads it in OOo."""
if
yformat_map
:
if
source_format
in
yformat_map
:
logger
.
debug
(
"OooConvert: xlsy > xlsx"
)
yformat
=
YformatHandler
(
base_folder_url
,
data
,
source_format
,
**
kw
)
destination_format
=
yformat_map
[
source_format
]
data
=
yformat
.
convert
(
destination_format
=
destination_format
)
source_format
=
destination_format
self
.
document
=
FileSystemDocument
(
base_folder_url
,
self
.
document
=
FileSystemDocument
(
base_folder_url
,
data
,
data
,
source_format
)
source_format
)
...
@@ -167,11 +154,6 @@ class Handler(object):
...
@@ -167,11 +154,6 @@ class Handler(object):
Keyword Arguments:
Keyword Arguments:
destination_format -- extension of document as String
destination_format -- extension of document as String
"""
"""
yformat
=
False
if
yformat_map
:
if
destination_format
in
yformat_map
:
yformat
=
destination_format
destination_format
=
yformat_map
[
destination_format
]
logger
.
debug
(
"OooConvert: %s > %s"
%
(
self
.
source_format
,
destination_format
))
logger
.
debug
(
"OooConvert: %s > %s"
%
(
self
.
source_format
,
destination_format
))
kw
[
'source_format'
]
=
self
.
source_format
kw
[
'source_format'
]
=
self
.
source_format
if
destination_format
:
if
destination_format
:
...
@@ -188,14 +170,6 @@ class Handler(object):
...
@@ -188,14 +170,6 @@ class Handler(object):
self
.
document
.
reload
(
url
)
self
.
document
.
reload
(
url
)
content
=
self
.
document
.
getContent
(
self
.
zip
)
content
=
self
.
document
.
getContent
(
self
.
zip
)
self
.
document
.
trash
()
self
.
document
.
trash
()
if
yformat
:
logger
.
debug
(
"OooConvert: xlsx > xlsy"
)
source_format
=
destination_format
kw
[
'destination_format'
]
=
yformat
yformat
=
YformatHandler
(
self
.
document
.
base_folder_url
,
content
,
source_format
)
content
=
yformat
.
convert
(
**
kw
)
return
content
return
content
def
getMetadata
(
self
,
base_document
=
False
):
def
getMetadata
(
self
,
base_document
=
False
):
...
...
cloudooo/handler/ooo/mimemapper.py
View file @
a962f44f
...
@@ -37,12 +37,6 @@ from cloudooo.interfaces.mimemapper import IMimemapper
...
@@ -37,12 +37,6 @@ from cloudooo.interfaces.mimemapper import IMimemapper
from
types
import
InstanceType
from
types
import
InstanceType
import
json
import
json
try
:
from
cloudooo.handler.x2t.handler
import
yformat_service_map
except
ImportError
:
yformat_service_map
=
{}
class
MimeMapper
(
object
):
class
MimeMapper
(
object
):
"""Load all filters from OOo. You can get the filter you want or all
"""Load all filters from OOo. You can get the filter you want or all
filters of the specific extension.
filters of the specific extension.
...
@@ -231,9 +225,6 @@ class MimeMapper(object):
...
@@ -231,9 +225,6 @@ class MimeMapper(object):
'pdf'
:
[
'com.sun.star.drawing.DrawingDocument'
],
'pdf'
:
[
'com.sun.star.drawing.DrawingDocument'
],
'xls'
:
[
'com.sun.star.sheet.SpreadsheetDocument'
],
'xls'
:
[
'com.sun.star.sheet.SpreadsheetDocument'
],
})
})
self
.
_doc_type_list_by_extension
.
update
((
ext
,
[
service
,
])
for
ext
,
service
in
yformat_service_map
.
iteritems
())
for
ext
,
service
in
yformat_service_map
.
iteritems
():
self
.
_extension_list_by_type
[
service
].
append
((
ext
,
ext
.
capitalize
()))
self
.
document_service_list
=
self
.
_extension_list_by_type
.
keys
()
self
.
document_service_list
=
self
.
_extension_list_by_type
.
keys
()
self
.
_loaded
=
True
self
.
_loaded
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment