Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions libzim/examples.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# This file is part of python-libzim
# (see https://github.com/libzim/python-libzim)
#
# Copyright (c) 2020 Juan Diego Caballero <jdc@monadical.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# 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, see <http://www.gnu.org/licenses/>.


from libzim import ZimArticle, ZimBlob, ZimCreator

class ZimTestArticle(ZimArticle):
Expand Down
24 changes: 23 additions & 1 deletion libzim/lib.cxx
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/*
* This file is part of python-libzim
* (see https://github.com/libzim/python-libzim)
*
* Copyright (c) 2020 Juan Diego Caballero <jdc@monadical.com>
* Copyright (c) 2020 Matthieu Gautier <mgautier@kymeria.fr>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* 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, see <http://www.gnu.org/licenses/>.
*/


#include <Python.h>
#include "lib.h"

Expand Down Expand Up @@ -241,4 +263,4 @@ void ZimCreatorWrapper::setMainUrl(std::string newUrl)
zim::writer::Url ZimCreatorWrapper::getMainUrl()
{
return _creator->getMainUrl();
}
}
21 changes: 20 additions & 1 deletion libzim/lib.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
// -*- c++ -*-
/*
* This file is part of python-libzim
* (see https://github.com/libzim/python-libzim)
*
* Copyright (c) 2020 Juan Diego Caballero <jdc@monadical.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef libzim_LIB_H
#define libzim_LIB_H 1

Expand Down Expand Up @@ -58,4 +77,4 @@ class ZimCreatorWrapper
zim::writer::Url getMainUrl();
};

#endif // !libzim_LIB_H
#endif // !libzim_LIB_H
19 changes: 19 additions & 0 deletions libzim/libzim.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# This file is part of python-libzim
# (see https://github.com/libzim/python-libzim)
#
# Copyright (c) 2020 Juan Diego Caballero <jdc@monadical.com>
# Copyright (c) 2020 Matthieu Gautier <mgautier@kymeria.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# 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, see <http://www.gnu.org/licenses/>.

from libcpp.string cimport string
from libc.stdint cimport uint32_t, uint64_t
from libcpp cimport bool
Expand Down
21 changes: 20 additions & 1 deletion libzim/libzim.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# This file is part of python-libzim
# (see https://github.com/libzim/python-libzim)
#
# Copyright (c) 2020 Juan Diego Caballero <jdc@monadical.com>
# Copyright (c) 2020 Matthieu Gautier <mgautier@kymeria.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# 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, see <http://www.gnu.org/licenses/>.

cimport libzim
cimport cpython.ref as cpy_ref
from cython.operator import dereference
Expand Down Expand Up @@ -345,4 +364,4 @@ cdef class ZimCreator:
self._finalized = True

def __repr__(self):
return f"{self.__class__.__name__}(filename={self.filename})"
return f"{self.__class__.__name__}(filename={self.filename})"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def read(fname):
author = "Monadical SAS",
author_email = "hello@monadical.com",
description = ("A python-facing API for creating and interacting with ZIM files"),
license = "GPLv3",
license = "GPLv3+",
long_description=read('README.md'),
ext_modules = cythonize([
Extension("libzim", ["libzim/*.pyx","libzim/lib.cxx"],
Expand Down
20 changes: 19 additions & 1 deletion tests/test_libzim.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# This file is part of python-libzim
# (see https://github.com/libzim/python-libzim)
#
i# Copyright (c) 2020 Juan Diego Caballero <jdc@monadical.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# 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, see <http://www.gnu.org/licenses/>.

import unittest
import os,sys,inspect

Expand Down Expand Up @@ -115,4 +133,4 @@ def test_check_mandatory_metadata(self):


if __name__ == '__main__':
unittest.main()
unittest.main()