🔨 shift NamedContent to plugin interface
This commit is contained in:
parent
a923bce3be
commit
c684c08efa
|
@ -1,7 +1,7 @@
|
|||
Extend pyexcel-io Tutorial
|
||||
================================================================================
|
||||
|
||||
You are welcome toextend pyexcel-io to read and write more tabular formats.
|
||||
You are welcome to extend pyexcel-io to read and write more tabular formats.
|
||||
No. 1 rule, your plugin must have a prefix 'pyexcel_' in its module path.
|
||||
For example, `pyexcel-xls` has 'pyexcel_xls' as its module path. Otherwise,
|
||||
pyexcel-io will not load your plugin.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
from .abstract_sheet import ISheet, ISheetWriter # noqa: F401
|
||||
from .abstract_sheet import ISheet, ISheetWriter, NamedContent # noqa: F401
|
||||
from .abstract_reader import IReader # noqa: F401
|
||||
from .abstract_writer import IWriter # noqa: F401
|
||||
|
|
|
@ -19,3 +19,13 @@ class ISheetWriter(object):
|
|||
|
||||
def close(self):
|
||||
raise NotImplementedError("How would you close your file")
|
||||
|
||||
|
||||
class NamedContent(object):
|
||||
"""
|
||||
Helper class for content that does not have a name
|
||||
"""
|
||||
|
||||
def __init__(self, name, payload):
|
||||
self.name = name
|
||||
self.payload = payload
|
||||
|
|
|
@ -10,16 +10,7 @@
|
|||
import pyexcel_io.constants as constants
|
||||
from pyexcel_io.utils import _index_filter
|
||||
from pyexcel_io._compact import irange
|
||||
|
||||
|
||||
class NamedContent(object):
|
||||
"""
|
||||
Helper class for content that does not have a name
|
||||
"""
|
||||
|
||||
def __init__(self, name, payload):
|
||||
self.name = name
|
||||
self.payload = payload
|
||||
from pyexcel_io.plugin_api import NamedContent # noqa: F401
|
||||
|
||||
|
||||
class SheetReader(object):
|
||||
|
|
Loading…
Reference in New Issue