# Path: books/epubinfo.py
# class EpubInfo(): #TODO: Cover the entire DC range
#     def __init__(self, opffile):
#     def _get_data(self, tagname):
#     def _get_description(self):
#     def _get_title(self):
#     def _get_creator(self):
#     def _get_date(self):
#     def _get_source(self):
#     def _get_rights(self):
#     def _get_identifier(self):
#     def _get_language(self):
#     def _get_subject(self):
#     def _get_cover_image(self):


import zipfile
import tempfile
import os, os.path
import shutil
from lxml import etree
from books import epubinfo
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA




class Epub(object):
    def __init__(self, _file):
        """
        _file: can be either a path to a file (a string) or a file-like object.
        """
        self._file = _file
        self._zobject = None
        self._opfpath = None
        self._ncxpath = None
        self._basepath = None
        self._tempdir = tempfile.mkdtemp()

        if not self._verify():
            print('Warning: This does not seem to be a valid epub file')

        self._get_opf()
        self._get_ncx()

        opffile = self._zobject.open(self._opfpath)

# Path: books/epubinfo.py
# class EpubInfo(): #TODO: Cover the entire DC range
#     def __init__(self, opffile):
#     def _get_data(self, tagname):
#     def _get_description(self):
#     def _get_title(self):
#     def _get_creator(self):
#     def _get_date(self):
#     def _get_source(self):
#     def _get_rights(self):
#     def _get_identifier(self):
#     def _get_language(self):
#     def _get_subject(self):
#     def _get_cover_image(self):


# Path: books/epub.py
import zipfile
import tempfile
import os, os.path
import shutil
from lxml import etree
from books import epubinfo

# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA




class Epub(object):
    def __init__(self, _file):
        """
        _file: can be either a path to a file (a string) or a file-like object.
        """
        self._file = _file
        self._zobject = None
        self._opfpath = None
        self._ncxpath = None
        self._basepath = None
        self._tempdir = tempfile.mkdtemp()

        if not self._verify():
            print('Warning: This does not seem to be a valid epub file')

        self._get_opf()
        self._get_ncx()

        opffile = self._zobject.open(self._opfpath)

        self._info = epubinfo.EpubInfo(opffile)