dev-python/biplist: new package, add 1.0.3

Signed-off-by: David Roman <davidroman96@gmail.com>
This commit is contained in:
David Roman 2023-08-13 16:46:17 +02:00
parent 24efd6bb9a
commit 88f88388a6
No known key found for this signature in database
GPG Key ID: D7475BA08F7705F5
4 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST biplist-1.0.3.tar.gz 21258 BLAKE2B 9ef9b827e3e4e0496545627e435a64a40fadc4580b8f61fe0cb40c96df5f3fa7559af4d117fe28ee777629efff0bc0f5789f03eca1314e375c93a0ada0018452 SHA512 186927481229988c713d9bb703115493001b129ed4e540e9a028e99b4f10e1576291c75f98d39b28e04092c14a9c96e4843c1445d9a318ced322323c7c1134b5

View File

@ -0,0 +1,24 @@
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_11 )
inherit distutils-r1 pypi
DESCRIPTION="A binary plist parser/generator for Python"
HOMEPAGE="https://pypi.org/project/biplist/ https://github.com/wooster/biplist"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND="dev-python/six[${PYTHON_USEDEP}]"
DEPEND="test? ( ${RDEPEND} )"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
PATCHES=( "${FILESDIR}/${PN}-python3-compat.patch" )
distutils_enable_tests nose

View File

@ -0,0 +1,33 @@
From: Stefano Rivera <stefanor@debian.org>
Date: Mon, 1 Feb 2021 17:58:06 -0700
Subject: Python 3.9: Use bytes with plistlib
Python 3.9 dropped the deprecated plistlib.Data class. Instead of
plistlib.Data, we can just use bytes directly.
Bug-Debian: https://bugs.debian.org/973082
Bug-Upstream: https://bitbucket.org/wooster/biplist/issues/12/python-39-compatibility
---
biplist/__init__.py | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/biplist/__init__.py b/biplist/__init__.py
index f9d5836..4a40602 100644
--- a/biplist/__init__.py
+++ b/biplist/__init__.py
@@ -147,14 +147,7 @@ def readPlist(pathOrFile):
return result
def wrapDataObject(o, for_binary=False):
- if isinstance(o, Data) and not for_binary:
- v = sys.version_info
- if not (v[0] >= 3 and v[1] >= 4):
- o = plistlib.Data(o)
- elif isinstance(o, (bytes, plistlib.Data)) and for_binary:
- if hasattr(o, 'data'):
- o = Data(o.data)
- elif isinstance(o, tuple):
+ if isinstance(o, tuple):
o = wrapDataObject(list(o), for_binary)
o = tuple(o)
elif isinstance(o, list):

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>davidroman96@gmail.com</email>
<name>David Roman</name>
</maintainer>
<upstream>
<remote-id type="github">wooster/biplist</remote-id>
<remote-id type="pypi">biplist</remote-id>
</upstream>
</pkgmetadata>