diff options
author | Mike Gilbert <floppym@gentoo.org> | 2011-08-29 00:37:47 +0000 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2011-08-29 00:37:47 +0000 |
commit | a45b3243428f4055be18e07c5262c19d5f01c859 (patch) | |
tree | 79fac1f60d00c0dd1e5c7035d53d585e094ab8e1 /dev-python/transmissionrpc | |
parent | New ebuild for bug 350015; thanks to Leszek Ciesielski for testing (diff) | |
download | gentoo-2-a45b3243428f4055be18e07c5262c19d5f01c859.tar.gz gentoo-2-a45b3243428f4055be18e07c5262c19d5f01c859.tar.bz2 gentoo-2-a45b3243428f4055be18e07c5262c19d5f01c859.zip |
New package for bug 377565
(Portage version: 2.2.0_alpha51/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/transmissionrpc')
-rw-r--r-- | dev-python/transmissionrpc/ChangeLog | 12 | ||||
-rw-r--r-- | dev-python/transmissionrpc/files/transmissionrpc-timestamp-test.patch | 55 | ||||
-rw-r--r-- | dev-python/transmissionrpc/metadata.xml | 9 | ||||
-rw-r--r-- | dev-python/transmissionrpc/transmissionrpc-0.7.ebuild | 34 | ||||
-rw-r--r-- | dev-python/transmissionrpc/transmissionrpc-9999.ebuild | 25 |
5 files changed, 135 insertions, 0 deletions
diff --git a/dev-python/transmissionrpc/ChangeLog b/dev-python/transmissionrpc/ChangeLog new file mode 100644 index 000000000000..16f8a1fbad7f --- /dev/null +++ b/dev-python/transmissionrpc/ChangeLog @@ -0,0 +1,12 @@ +# ChangeLog for dev-python/transmissionrpc +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/transmissionrpc/ChangeLog,v 1.1 2011/08/29 00:37:47 floppym Exp $ + +*transmissionrpc-9999 (29 Aug 2011) +*transmissionrpc-0.7 (29 Aug 2011) + + 29 Aug 2011; Mike Gilbert <floppym@gentoo.org> +transmissionrpc-0.7.ebuild, + +transmissionrpc-9999.ebuild, +files/transmissionrpc-timestamp-test.patch, + +metadata.xml: + New package for bug 377565 + diff --git a/dev-python/transmissionrpc/files/transmissionrpc-timestamp-test.patch b/dev-python/transmissionrpc/files/transmissionrpc-timestamp-test.patch new file mode 100644 index 000000000000..3f7384b3a301 --- /dev/null +++ b/dev-python/transmissionrpc/files/transmissionrpc-timestamp-test.patch @@ -0,0 +1,55 @@ +# HG changeset patch +# User Mike Gilbert <floppymaster@gmail.com> +# Date 1312249052 14400 +# Node ID 144110dc47fae14f2692afa1be1e57d461b7393e +# Parent 4fe71eb818d0a220b8fe6370fa00c997e7f12e4b +Use UTC for utils.format_timestamp unit test. + +This removes dependence on the local time zone when running tests. + +diff --git a/test/utils.py b/test/utils.py +--- a/test/utils.py ++++ b/test/utils.py +@@ -55,11 +55,11 @@ + def testFormatTimestamp(self): + table = { + 0: '-', +- 1: '1970-01-01 01:00:01', +- 1129135532: '2005-10-12 18:45:32', ++ 1: '1970-01-01 00:00:01', ++ 1129135532: '2005-10-12 16:45:32', + } + for timestamp, expected in table.iteritems(): +- self.assertEqual(tu.format_timestamp(timestamp), expected) ++ self.assertEqual(tu.format_timestamp(timestamp, utc=True), expected) + + def testInetAddress(self): + table = { +@@ -97,4 +97,4 @@ + return suite + + if __name__ == '__main__': +- unittest.main() +\ No newline at end of file ++ unittest.main() +diff --git a/transmissionrpc/utils.py b/transmissionrpc/utils.py +--- a/transmissionrpc/utils.py ++++ b/transmissionrpc/utils.py +@@ -34,12 +34,15 @@ + hours, minutes = divmod(minutes, 60) + return '%d %02d:%02d:%02d' % (delta.days, hours, minutes, seconds) + +-def format_timestamp(timestamp): ++def format_timestamp(timestamp, utc=False): + """ + Format unix timestamp into ISO date format. + """ + if timestamp > 0: +- dt_timestamp = datetime.datetime.fromtimestamp(timestamp) ++ if utc: ++ dt_timestamp = datetime.datetime.utcfromtimestamp(timestamp) ++ else: ++ dt_timestamp = datetime.datetime.fromtimestamp(timestamp) + return dt_timestamp.isoformat(' ') + else: + return '-' diff --git a/dev-python/transmissionrpc/metadata.xml b/dev-python/transmissionrpc/metadata.xml new file mode 100644 index 000000000000..e6093f985285 --- /dev/null +++ b/dev-python/transmissionrpc/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>no-herd</herd> + <maintainer> + <email>floppym@gentoo.org</email> + <name>Mike Gilbert</name> + </maintainer> +</pkgmetadata> diff --git a/dev-python/transmissionrpc/transmissionrpc-0.7.ebuild b/dev-python/transmissionrpc/transmissionrpc-0.7.ebuild new file mode 100644 index 000000000000..b162a3932df0 --- /dev/null +++ b/dev-python/transmissionrpc/transmissionrpc-0.7.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/transmissionrpc/transmissionrpc-0.7.ebuild,v 1.1 2011/08/29 00:37:47 floppym Exp $ + +EAPI=3 + +PYTHON_DEPEND="2:2.6" +SUPPORT_PYTHON_ABIS=1 +RESTRICT_PYTHON_ABIS="2.[45] 3.*" +DISTUTILS_SRC_TEST="setup.py" + +inherit distutils eutils + +DESCRIPTION="Python module that implements the Transmission bittorrent client RPC protocol" +HOMEPAGE="https://bitbucket.org/blueluna/transmissionrpc" +SRC_URI="https://bitbucket.org/blueluna/${PN}/get/release-${PV}.tar.bz2 -> ${P}.tar.bz2" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" + +DEPEND="dev-python/setuptools" +RDEPEND="" + +src_unpack() { + default + mv blueluna-${PN}-* "${S}" || die +} + +src_prepare() { + epatch "${FILESDIR}/${PN}-timestamp-test.patch" + distutils_src_prepare +} diff --git a/dev-python/transmissionrpc/transmissionrpc-9999.ebuild b/dev-python/transmissionrpc/transmissionrpc-9999.ebuild new file mode 100644 index 000000000000..78cbea2c8487 --- /dev/null +++ b/dev-python/transmissionrpc/transmissionrpc-9999.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/transmissionrpc/transmissionrpc-9999.ebuild,v 1.1 2011/08/29 00:37:47 floppym Exp $ + +EAPI=3 + +PYTHON_DEPEND="2:2.6" +SUPPORT_PYTHON_ABIS=1 +RESTRICT_PYTHON_ABIS="2.[45] 3.*" +DISTUTILS_SRC_TEST="setup.py" + +inherit distutils mercurial + +DESCRIPTION="Python module that implements the Transmission bittorrent client RPC protocol" +HOMEPAGE="https://bitbucket.org/blueluna/transmissionrpc" +SRC_URI="" +EHG_REPO_URI="https://bitbucket.org/blueluna/${PN}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="" +IUSE="" + +DEPEND="dev-python/setuptools" +RDEPEND="" |