Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
* Remove the vim-specific lines.
* Remove the UTF-8 encoding specifiers - UTF-8 is the default.
* Update the copyright notices.
  • Loading branch information
FriedrichFroebel committed Feb 17, 2024
1 parent 10af362 commit 1099dc6
Show file tree
Hide file tree
Showing 46 changed files with 100 additions and 109 deletions.
9 changes: 2 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
1 change: 0 additions & 1 deletion .github/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/check-for-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ jobs:
- name: check for library updates
run:
./private/check-for-updates

# vim:ts=2 sts=2 sw=2 et
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
main:
strategy:
matrix:
python: [3.8, 3.9, '3.10', '3.11', '3.12']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
name: Python ${{ matrix.python }}
steps:
Expand Down Expand Up @@ -144,5 +144,3 @@ jobs:
run: |
cd /
python -c 'import djvu.sexpr, djvu.decode'
# vim:ts=2 sts=2 sw=2 et
2 changes: 0 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ msg-template = {path}:{line}: {C}: {symbol} [{obj}] {msg}
[FORMAT]
max-line-length = 120
expected-line-ending-format = LF

# vim:ft=dosini ts=4 sts=4 sw=4 et
8 changes: 1 addition & 7 deletions djvu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding=UTF-8

# Copyright © 2015-2021 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand All @@ -12,8 +11,3 @@
# 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.

type(b'') # Python >= 2.6 is required
type(u'') # Python 2.X or >= 3.3 is required

# vim:ts=4 sts=4 sts=4 sw=4 et
3 changes: 1 addition & 2 deletions djvu/common.pxi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright © 2008-2018 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -122,5 +123,3 @@ cdef int typecheck(object o, object type):

cdef void raise_instantiation_error(object cls) except *:
raise TypeError(f"cannot create '{get_type_name(cls)}' instances")

# vim:ts=4 sts=4 sw=4 et ft=pyrex
5 changes: 1 addition & 4 deletions djvu/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding=UTF-8

# Copyright © 2008-2015 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -261,5 +260,3 @@ def get_text_zone_type(symbol):
'TextZoneType',
'get_text_zone_type'
]

# vim:ts=4 sts=4 sw=4 et
3 changes: 1 addition & 2 deletions djvu/decode.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright © 2007-2020 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -394,5 +395,3 @@ cdef class ProgressMessage(Message):

cdef class Thumbnail:
cdef Page _page

# vim:ts=4 sts=4 sw=4 et ft=pyrex
3 changes: 1 addition & 2 deletions djvu/decode.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright © 2007-2022 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -3376,5 +3377,3 @@ cdef class Metadata:

__author__ = 'Jakub Wilk <jwilk@jwilk.net>'
__version__ = decode_utf8(PYTHON_DJVULIBRE_VERSION)

# vim:ts=4 sts=4 sw=4 et ft=pyrex
3 changes: 1 addition & 2 deletions djvu/sexpr.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright © 2007-2018 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -30,5 +31,3 @@ cdef class _WrappedCExpr:

cdef object public_c2py(cexpr_t)
cdef _WrappedCExpr public_py2c(object)

# vim:ts=4 sts=4 sw=4 et ft=pyrex
3 changes: 1 addition & 2 deletions djvu/sexpr.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright © 2007-2019 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -966,5 +967,3 @@ __all__ = (

__author__ = 'Jakub Wilk <jwilk@jwilk.net>'
__version__ = decode_utf8(PYTHON_DJVULIBRE_VERSION)

# vim:ts=4 sts=4 sw=4 et ft=pyrex
2 changes: 0 additions & 2 deletions doc/README
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,3 @@ Acknowledgment
python-djvulibre development was supported by the Polish Ministry of Science
and Higher Education's grant no. N N519 384036 (2009–2012,
https://bitbucket.org/jsbien/ndt).

.. vim:ft=rst ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/annotations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,5 +421,3 @@ The following symbols are pre-defined:

>>> PRINTER_HEADER_ALIGN_RIGHT
Symbol('right')

.. vim:ts=3 sts=3 sw=3 et
5 changes: 1 addition & 4 deletions doc/api/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding=UTF-8

# Copyright © 2009-2021 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFröbel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -64,5 +63,3 @@ def setup(app):
# deprecated in Sphinx 1.8, removed in 4.0
add_css_file = app.add_stylesheet
add_css_file('docutils-math.css')

# vim:ts=4 sts=4 sw=4 et
2 changes: 0 additions & 2 deletions doc/api/documents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,3 @@ DjVu documents
Document decoding job.

Use :attr:`Document.decoding_job` to obtain instances of this class.

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/event-model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,3 @@ The DDJVU API hides this complexity with a familiar event model.
.. method:: wait()

Wait until the job is done.

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,3 @@ Job status
.. exception:: JobStopped

Operation was interrupted by user.

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,3 @@ Varieties

>>> EMPTY_LIST
Expression([])

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,3 @@ Document files
:attr:`~Message.page_job` may be emitted.

:raise NotAvailable: see above.

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/geometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,3 @@ Render modes
.. data:: djvu.decode.RENDER_FOREGROUND

Render color foreground layer.

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ Contents:
exceptions

* :ref:`search`

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,3 @@ Messages
.. attribute:: status

:return: a :class:`JobException` subclass indicating the current job status.

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/outline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ Document outline

>>> EMPTY_OUTLINE
Expression([Symbol('bookmarks')])

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,3 @@ Document pages
actual image data.

:raise NotAvailable: when no thumbnail is available.

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/api/static/docutils-math.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@
display: block;
border-top: thin solid;
}

/* vim:set ts=4 sts=4 st=4 et:*/
2 changes: 0 additions & 2 deletions doc/api/text-zones.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,3 @@ Text zones
<djvu.const.TextZoneType: region>: '\x1d',
<djvu.const.TextZoneType: column>: '\x0b',
<djvu.const.TextZoneType: page>: '\x0c'}

.. vim:ts=3 sts=3 sw=3 et
2 changes: 0 additions & 2 deletions doc/todo
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@

* Cython ≥ 0.23 provides the plugin ``Cython.Coverage``
that can be added to ``.coveragerc``.

.. vim:ft=rst ts=3 sts=3 sw=3 et tw=72
4 changes: 1 addition & 3 deletions examples/djvu-crop-text
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding=UTF-8

# Copyright © 2008-2018 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -112,5 +112,3 @@ def main():

if __name__ == '__main__':
main()

# vim:ts=4 sts=4 sw=4 et
4 changes: 1 addition & 3 deletions examples/djvu-dump-text
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding=UTF-8

# Copyright © 2008-2018 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -61,5 +61,3 @@ def main():

if __name__ == '__main__':
main()

# vim:ts=4 sts=4 sw=4 et
4 changes: 1 addition & 3 deletions examples/djvu2png
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding=UTF-8

# Copyright © 2010-2021 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -80,5 +80,3 @@ def main():

if __name__ == '__main__':
main()

# vim:ts=4 sts=4 sw=4 et
15 changes: 15 additions & 0 deletions private/check-for-updates
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
#!/usr/bin/env python

# Copyright © 2023-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
# python-djvulibre is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation. If you like, you might use the
# `check_for_updates` script under the terms of the MIT license as well, id
# est this file can be considered "GPL-2.0-only OR MIT".
#
# python-djvulibre 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.

import sys
from pathlib import Path

Expand Down
3 changes: 1 addition & 2 deletions private/check-rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

# Copyright © 2016-2022 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -37,5 +38,3 @@ else
printf '%s\n' "$@"
fi |
xargs -t -I{} "$rst2xml" $options {} /dev/null

# vim:ts=4 sts=4 sw=4 et
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ requires = [
'Cython>=0.28',
'packaging',
]

# vim:ts=4 sts=4 sw=4 et
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding=UTF-8

# Copyright © 2007-2022 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
Expand Down Expand Up @@ -265,5 +264,3 @@ def make_release_tree(self, base_dir, files):
if __name__ == '__main__':
# Required for Sphinx.
setuptools.setup(**setup_params)

# vim:ts=4 sts=4 sw=4 et
12 changes: 12 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright © 2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
# python-djvulibre is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# python-djvulibre 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.
12 changes: 12 additions & 0 deletions tests/examples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright © 2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
# python-djvulibre is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# python-djvulibre 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.
13 changes: 13 additions & 0 deletions tests/examples/test_djvu2png.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright © 2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
# python-djvulibre is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# python-djvulibre 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.

import os
import subprocess
from importlib.util import find_spec
Expand Down
13 changes: 13 additions & 0 deletions tests/examples/test_djvu_crop_text.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright © 2024 FriedrichFroebel
#
# This file is part of python-djvulibre.
#
# python-djvulibre is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# python-djvulibre 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.

import os
import subprocess

Expand Down
Loading

0 comments on commit 1099dc6

Please sign in to comment.