Skip to content

Commit cd8701b

Browse files
committed
update lml plugin interface
1 parent 5909dde commit cd8701b

File tree

7 files changed

+28
-18
lines changed

7 files changed

+28
-18
lines changed

Diff for: .gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,5 @@ ENV/
9191
.ropeproject
9292
*~
9393
commons/
94-
doc/build/
95-
cover/
96-
coverage/
94+
commons
95+
.moban.hashes

Diff for: .moban.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ targets:
1111
- .travis.yml: travis.yml
1212
- requirements.txt: requirements.txt
1313
- MANIFEST.in: MANIFEST.in.jj2
14+
- .gitignore: .gitignore.jj2
1415
- "tests/requirements.txt": "tests/requirements.txt"
1516
- test.sh: test.sh.jj2
1617
- test.bat: test.sh.jj2

Diff for: docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
project = u'pyexcel-odsr'
2323
copyright = u'2015-2017 Onni Software Ltd.'
24-
version = '0.3.0'
24+
version = '0.3.1'
2525
release = '0.4.0'
2626
exclude_patterns = []
2727
pygments_style = 'sphinx'

Diff for: pyexcel_odsr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ overrides: "pyexcel.yaml"
22
name: "pyexcel-odsr"
33
nick_name: odsr
44
version: 0.4.0
5-
release: 0.3.0
5+
release: 0.3.1
66
file_type: ods
77
dependencies:
88
- pyexcel-io>=0.4.0

Diff for: pyexcel_odsr/__init__.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
# flake8: noqa
99
# this line has to be place above all else
1010
# because of dynamic import
11+
from pyexcel_io.plugins import IORegistry
12+
from pyexcel_io.io import get_data as read_data, isstream, store_data as write_data
13+
1114
__FILE_TYPE__ = 'ods'
12-
__META__ = {
13-
'plugin_type': 'pyexcel io plugin',
14-
'submodule': __FILE_TYPE__,
15-
'file_types': [__FILE_TYPE__],
16-
'stream_type': 'binary'
17-
}
18-
__pyexcel_io_plugins__ = [__META__]
15+
IORegistry(__name__).add_a_reader(
16+
submodule='odsr.ODSBook',
17+
file_types=[__FILE_TYPE__],
18+
stream_type='binary'
19+
)
1920

2021

2122
from pyexcel_io.io import get_data as read_data, isstream

Diff for: pyexcel_odsr/ods.py renamed to pyexcel_odsr/odsr.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
pyexcel_odsr.odsr
3+
~~~~~~~~~~~~~~~~~~~
4+
The lower level ods file format handler using messytables
5+
6+
:copyright: (c) 2015-2017 by Onni Software Ltd & its contributors
7+
:license: New BSD License
8+
"""
19
import sys
210
import math
311

Diff for: tests/test_ods_reader.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import os
2-
from pyexcel_odsr import ods as odsr
3-
from pyexcel_ods import ods
2+
from pyexcel_odsr.odsr import ODSBook
3+
from pyexcel_ods.odsw import ODSWriter
4+
45
from base import ODSCellTypes
56

67

78
class TestODSReader(ODSCellTypes):
89
def setUp(self):
9-
r = odsr.ODSBook()
10+
r = ODSBook()
1011
r.open(os.path.join("tests",
1112
"fixtures",
1213
"ods_formats.ods"))
@@ -18,17 +19,17 @@ def setUp(self):
1819

1920
class TestODSWriter(ODSCellTypes):
2021
def setUp(self):
21-
r = odsr.ODSBook()
22+
r = ODSBook()
2223
r.open(os.path.join("tests",
2324
"fixtures",
2425
"ods_formats.ods"))
2526
self.data1 = r.read_all()
2627
self.testfile = "odswriter.ods"
27-
w = ods.ODSWriter()
28+
w = ODSWriter()
2829
w.open(self.testfile)
2930
w.write(self.data1)
3031
w.close()
31-
r2 = odsr.ODSBook()
32+
r2 = ODSBook()
3233
r2.open(self.testfile)
3334
self.data = r2.read_all()
3435
for key in self.data.keys():

0 commit comments

Comments
 (0)