Skip to content

Commit 52053f1

Browse files
committed
update plugin protocol
1 parent 3bfe8a3 commit 52053f1

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

pyexcel_text/__init__.py

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,32 @@
77
:copyright: (c) 2014-2016 by C. W.
88
:license: New BSD
99
"""
10-
__pyexcel_renderer_plugins__ = ['_text', '_json']
11-
12-
13-
_SHARED_MESSAGE = """
14-
Removed since v0.1.2! Please use save_as, save_book_as of pyexcel or
15-
pyexcel.Sheet.save_as, pyexcel.Book.save_as.
16-
"""
17-
18-
19-
def save_as(instance, filename):
20-
"""
21-
Legacy modular function. Now it is removed
22-
23-
raising an exception here to get the attention of
24-
the user of pyexcel
25-
"""
26-
raise Exception(_SHARED_MESSAGE)
27-
28-
29-
def save_to_memory(instance, stream):
30-
"""
31-
Legacy modular function. Now it is removed
32-
33-
raising an exception here to get the attention of
34-
the user of pyexcel
35-
"""
36-
raise Exception(_SHARED_MESSAGE)
10+
__TEXT_META__ = {
11+
'plugin_type': 'renderer',
12+
'submodule': '_text',
13+
'file_types': [
14+
'html',
15+
'simple',
16+
'plain',
17+
'grid',
18+
'pipe',
19+
'orgtbl',
20+
'rst',
21+
'mediawiki',
22+
'latex',
23+
'latex_booktabs'
24+
],
25+
'stream_type': 'string'
26+
}
27+
28+
__JSON_META__ = {
29+
'plugin_type': 'renderer',
30+
'submodule': '_json',
31+
'file_types': ['json'],
32+
'stream_type': 'string'
33+
}
34+
35+
__pyexcel_plugins__ = [
36+
__TEXT_META__,
37+
__JSON_META__
38+
]

pyexcel_text/_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010
import tabulate
1111

12-
from pyexcel.generators import SheetStream
12+
from pyexcel.internal.generators import SheetStream
1313
from pyexcel.sheets.matrix import uniform
1414
from pyexcel.renderers.factory import Renderer
1515

0 commit comments

Comments
 (0)