Skip to content

Commit 90134f9

Browse files
committed
mod: fix compatibility with packaged Picard
Replaced dataclass with namedtuple. While the dataclass provided better typing and generally a cleaner, more readable definition, it is not used by Picard and hence not available in the PyInstaller packages.
1 parent acb303a commit 90134f9

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

plugins/mod/__init__.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright (C) 2022 Philipp Wolfer
3+
# Copyright (C) 2022, 2025 Philipp Wolfer
44
#
55
# This program is free software; you can redistribute it and/or
66
# modify it under the terms of the GNU General Public License
@@ -25,12 +25,12 @@
2525
'There is limited support for writing the title tag as track name for '
2626
'some formats.'
2727
)
28-
PLUGIN_VERSION = "0.1"
28+
PLUGIN_VERSION = "0.2"
2929
PLUGIN_API_VERSIONS = ["2.8"]
3030
PLUGIN_LICENSE = "GPL-2.0"
3131
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"
3232

33-
from dataclasses import dataclass
33+
from collections import namedtuple
3434
from enum import Enum
3535
from io import RawIOBase
3636
import struct
@@ -49,13 +49,7 @@ class FieldAccess(Enum):
4949
READ_WRITE = 1
5050

5151

52-
@dataclass
53-
class StaticField:
54-
name: str
55-
offset: int
56-
length: int
57-
access: FieldAccess
58-
fillchar: str = ' '
52+
StaticField = namedtuple('StaticField', 'name offset length access fillchar', defaults=(' ',))
5953

6054

6155
class MagicBytes(bytes):

0 commit comments

Comments
 (0)