From 5577c1157056f1c4ac7e8a55a79aa2ef4ac6b3ae5d77d6a9e634863d72fd65bf Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 26 Oct 2020 09:15:45 +0000 Subject: [PATCH] Accepting request 844026 from home:jayvdb:py-submit dep of pdbpp c.f. https://build.opensuse.org/package/show/home:jayvdb:py-new/python-pdbpp#comment-1338640 OBS-URL: https://build.opensuse.org/request/show/844026 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wmctrl?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++++ .gitignore | 1 + LICENSE | 21 +++++++++++++ pr_3.patch | 48 ++++++++++++++++++++++++++++ wmctrl-0.3.tar.gz | 3 ++ wmctrl.changes | 12 +++++++ wmctrl.spec | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 187 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 pr_3.patch create mode 100644 wmctrl-0.3.tar.gz create mode 100644 wmctrl.changes create mode 100644 wmctrl.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3faeac3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2008-2020 Antonio Cuni + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/pr_3.patch b/pr_3.patch new file mode 100644 index 0000000..05ca5d7 --- /dev/null +++ b/pr_3.patch @@ -0,0 +1,48 @@ +From c92ac1ea187c9a407156705bd1b0de8afd2530e1 Mon Sep 17 00:00:00 2001 +From: John Vandenberg +Date: Mon, 26 Oct 2020 13:05:53 +0700 +Subject: [PATCH] Python 3 support + +Fixes https://github.com/antocuni/wmctrl/issues/2 +--- + wmctrl.py | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +Index: wmctrl-0.3/wmctrl.py +=================================================================== +--- wmctrl-0.3.orig/wmctrl.py ++++ wmctrl-0.3/wmctrl.py +@@ -1,5 +1,10 @@ + import os +-from commands import getoutput ++ ++try: ++ from commands import getoutput ++except ImportError: ++ from subprocess import getoutput ++ + try: + from collections import namedtuple + except ImportError: +@@ -15,8 +20,8 @@ class Window(BaseWindow): + windows = [] + for line in out.splitlines(): + parts = line.split(None, len(Window._fields)-2) +- parts = map(str.strip, parts) +- parts[1:7] = map(int, parts[1:7]) ++ parts = list(map(str.strip, parts)) ++ parts[1:7] = list(map(int, parts[1:7])) + parts.append(_wm_window_role(parts[0])) + windows.append(cls(*parts)) + return windows +@@ -68,8 +73,8 @@ class Window(BaseWindow): + + def set_geometry(self, geometry): + dim, pos = geometry.split('+', 1) +- w, h = map(int, dim.split('x')) +- x, y = map(int, pos.split('+')) ++ w, h = list(map(int, dim.split('x'))) ++ x, y = list(map(int, pos.split('+'))) + self.resize_and_move(x, y, w, h) + + def set_properties(self,properties): diff --git a/wmctrl-0.3.tar.gz b/wmctrl-0.3.tar.gz new file mode 100644 index 0000000..85dc29b --- /dev/null +++ b/wmctrl-0.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d806f65ac1554366b6e31d29d7be2e8893996c0acbb2824bbf2b1f49cf628a13 +size 2505 diff --git a/wmctrl.changes b/wmctrl.changes new file mode 100644 index 0000000..6fc9bc9 --- /dev/null +++ b/wmctrl.changes @@ -0,0 +1,12 @@ +------------------------------------------------------------------- +Mon Oct 26 04:41:39 UTC 2020 - John Vandenberg + +- Add pr_3.patch to fix Python 3 +- Activate test suite +- Update URL from Bitbucket to GitHub +- Add LICENSE from new upstream + +------------------------------------------------------------------- +Thu Apr 11 15:25:22 UTC 2019 - John Vandenberg + +- Initial spec for v0.3 diff --git a/wmctrl.spec b/wmctrl.spec new file mode 100644 index 0000000..f10b4f5 --- /dev/null +++ b/wmctrl.spec @@ -0,0 +1,79 @@ +# +# spec file for package wmctrl +# +# Copyright (c) 2020 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-wmctrl +Version: 0.3 +Release: 0 +Summary: Python programmatic control of X windows +License: MIT +Group: Development/Languages/Python +# Project is in the process of transitioning from Bitbucket to GitHub +URL: https://github.com/antocuni/wmctrl +Source: https://files.pythonhosted.org/packages/source/w/wmctrl/wmctrl-%{version}.tar.gz +Source1: https://raw.githubusercontent.com/antocuni/wmctrl/master/LICENSE +# Backport ofhttps://github.com/antocuni/wmctrl/pull/3 +Patch0: pr_3.patch +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: openbox +BuildRequires: python-rpm-macros +BuildRequires: wmctrl +BuildRequires: xclock +BuildRequires: xfontsel +BuildRequires: xorg-x11-server +BuildRequires: xvfb-run +Requires: wmctrl +Requires: xorg-x11-server +BuildArch: noarch +%python_subpackages + +%description +Python tool to programmatically control windows inside X. + +%prep +%setup -q -n wmctrl-%{version} +%patch0 -p1 +cp %{SOURCE1} . + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%{python_expand # +cat > /tmp/test_script.sh <