Skip to content

Commit

Permalink
Version 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tkarabela committed May 19, 2024
1 parent 445f1c3 commit 6b03f82
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2023 Tomas Karabela
Copyright (c) 2014-2024 Tomas Karabela

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

# General information about the project.
project = u'pysubs2'
copyright = u'2014-2023, Tomas Karabela'
copyright = u'2014-2024, Tomas Karabela'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ License

.. code-block:: text
Copyright (c) 2014-2023 Tomas Karabela
Copyright (c) 2014-2024 Tomas Karabela
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 23 additions & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
Release Notes
=============

**1.7.0** --- released on 2024-05-19

- Added ``errors`` option for :meth:`pysubs2.load()`, :meth:`pysubs2.SSAFile.save()` and related methods, exposing
the encoding handling option of builtin function ``open()``. By default, this option uses value ``None`` which
is consistent with behaviour of previous versions of the library. However, it's possible to use ``"surrogateescape"``
to bypass the need to specify correct character encoding in some cases (see the tutorial). In the CLI, surrogateescape
is now the default behaviour.
- SubStation writer now correctly handles timestamps which are not rounded to centiseconds, for example
``00:36:48,998`` from a SRT file no longer produces the invalid ASS timestamp ``0:36:48.100`` (Issue #83),
patch by moi15moi (https://github.com/moi15moi)
- MicroDVD parser now only uses FPS declaration from the first subtitle if the line starts with ``{1}{1}``,
matching VLC Player behaviour; the old behaviour is available under the ``strict_fps_inference`` reader option
(Issue #71)
- SubStation writer now omits fractional part for numeric values if it is zero, patch by Andrey Efremov (https://github.com/PalmtopTiger)
- CLI now shows help message when called without arguments (Issue #81), patches by Northurland (https://github.com/Northurland) and Andrey Efremov (https://github.com/PalmtopTiger)
- pysubs2 now raises correct exception (:class:`pysubs2.exceptions.FormatAutodetectionError`) when attempting to read
a JSON file that was not saved by pysubs2 (Issue #85)
- More robust SubStation parser (Issues #87, #89)
- Added test data to source distribution (Issue #75)
- Code now passes MyPy check in strict mode, as well as Ruff check
- Added support for Python 3.12, removed support for Python 3.7


**1.6.1** --- released on 2023-04-02

- WebVTT now correctly writes events in cue start order, patch by Anton Melser (https://github.com/AntonOfTheWoods)
Expand Down
2 changes: 1 addition & 1 deletion pysubs2/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def to_ssa_alignment(self) -> int:


#: Version of the pysubs2 library.
VERSION = "1.6.1"
VERSION = "1.7.0"


IntOrFloat = Union[int, float]
7 changes: 6 additions & 1 deletion pysubs2/formats/microdvd.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ def from_file(cls, subs: "SSAFile", fp: TextIO, format_: str, fps: Optional[floa
Keyword args:
strict_fps_inference: If True (default), in the case when ``fps`` is not given, it will be read
from the first subtitle text only if the start and end frame of this subtitle is ``{1}{1}``
(matches VLC Player behaviour), otherwise `UnknownFPSError` is raised. When ``strict_fps_inference``
(matches VLC Player behaviour), otherwise :class:`pysubs2.exceptions.UnknownFPSError` is raised.
When ``strict_fps_inference``
is False, framerate will be read from the first subtitle text in this case regardless of
start and end frame (which may result in bogus result, if the first subtitle is not supposed
to contain framerate). Before introduction of this option, the library behaved as if this
option was False.
.. versionchanged:: 1.7.0
Added the ``strict_fps_inference`` option.
"""
for line in fp:
match = MICRODVD_LINE.match(line)
Expand Down

0 comments on commit 6b03f82

Please sign in to comment.