using pkgutil

This commit is contained in:
chfw 2014-12-04 22:43:43 +00:00
parent cc85021089
commit 651153c85a
5 changed files with 20 additions and 18 deletions

2
pyexcel/__init__.py Normal file
View File

@ -0,0 +1,2 @@
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)

View File

@ -150,3 +150,21 @@ class XLWriter(BookWriter):
This call actually save the file
"""
self.wb.save(self.file)
try:
from pyexcel.io import READERS
from pyexcel.io import WRITERS
READERS.update({
"xls": XLBook,
"xlsm": XLBook,
"xlsx": XLBook
})
WRITERS.update({
"xls": XLWriter
})
except:
# to allow this module to function independently
pass
__VERSION__ = "0.0.1"

View File

@ -1,18 +0,0 @@
from .xlbook import XLBook, XLWriter
try:
from pyexcel.io import READERS
from pyexcel.io import WRITERS
READERS.update({
"xls": XLBook,
"xlsm": XLBook,
"xlsx": XLBook
})
WRITERS.update({
"xls": XLWriter
})
except:
# to allow this module to function independently
pass
__VERSION__ = "0.0.1"