summarylogtreecommitdiffstats
path: root/rt2rtng_python3.patch
blob: e3e6d04bf7c3fb45e7d3974204c117ec4f15a993 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From 49bddec6aacc49bee8d4d24dcf99657b98d318ae Mon Sep 17 00:00:00 2001
From: Ed Bruck <ed.bruck1@gmail.com>
Date: Mon, 8 Jul 2019 07:31:13 -0700
Subject: [PATCH] Remove python2 dependency

Fixes #118
---
 package/CMakeLists.txt                  |  4 ++--
 src/radiotray-ng/extras/scripts/rt2rtng | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/package/CMakeLists.txt b/package/CMakeLists.txt
index 7c48e86..273fe46 100644
--- a/package/CMakeLists.txt
+++ b/package/CMakeLists.txt
@@ -48,7 +48,7 @@ if (LSB_RELEASE_EXECUTABLE)
         set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE  ${CPACK_SYSTEM_NAME})
         set(CPACK_DEBIAN_PACKAGE_PRIORITY      "optional")
         set(CPACK_DEBIAN_PACKAGE_MAINTAINER    "Edward G. Bruck <ed.bruck1@gmail.com>")
-        set(CPACK_DEBIAN_PACKAGE_DEPENDS       "libc6, libbsd0, libcurl4, libjsoncpp1, libxdg-basedir1, libnotify4, python2.7, python-lxml, libglibmm-2.4-1v5, libboost-filesystem${BOOST_DEB_VERSION}, libboost-system${BOOST_DEB_VERSION}, libboost-log${BOOST_DEB_VERSION}, libboost-thread${BOOST_DEB_VERSION}, libboost-program-options${BOOST_DEB_VERSION}, libgstreamer1.0-0, libappindicator3-1, gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad, gstreamer1.0-plugins-ugly, libwxgtk3.0-0v5")
+        set(CPACK_DEBIAN_PACKAGE_DEPENDS       "libc6, libbsd0, libcurl4, libjsoncpp1, libxdg-basedir1, libnotify4, python3-lxml, libglibmm-2.4-1v5, libboost-filesystem${BOOST_DEB_VERSION}, libboost-system${BOOST_DEB_VERSION}, libboost-log${BOOST_DEB_VERSION}, libboost-thread${BOOST_DEB_VERSION}, libboost-program-options${BOOST_DEB_VERSION}, libgstreamer1.0-0, libappindicator3-1, gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad, gstreamer1.0-plugins-ugly, libwxgtk3.0-0v5")
         set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${PROJECT_SOURCE_DIR}/package/postinst;${PROJECT_SOURCE_DIR}/package/postrm;${PROJECT_SOURCE_DIR}/package/conffiles)
 
         # no libcurl4 on Debian Stretch
@@ -73,7 +73,7 @@ if (LSB_RELEASE_EXECUTABLE)
     if (CPACK_GENERATOR MATCHES "RPM")
         set(CPACK_PACKAGE_DESCRIPTION_SUMMARY  "Simple Internet Radio Player. Radiotray-NG runs in the system tray allowing you to select and play configured radio stations.")
         set(CPACK_RPM_PACKAGE_URL      "https://www.github.com/ebruck/radiotray-ng")
-        set(CPACK_RPM_PACKAGE_REQUIRES "glibc, libcurl, jsoncpp, boost, libxdg-basedir, libbsd, libappindicator-gtk3, libnotify, glibmm24, python2-lxml, gstreamer-plugins-base, gstreamer-plugins-good, gstreamer-plugins-bad-free, wxGTK3")
+        set(CPACK_RPM_PACKAGE_REQUIRES "glibc, libcurl, jsoncpp, boost, libxdg-basedir, libbsd, libappindicator-gtk3, libnotify, glibmm24, python3-lxml, gstreamer-plugins-base, gstreamer-plugins-good, gstreamer-plugins-bad-free, wxGTK3")
         set(CPACK_RPM_PACKAGE_GROUP    "Applications/Multimedia")
         set(CPACK_RPM_PACKAGE_LICENSE  "GPLv3")
         set(CPACK_RPM_COMPRESSION_TYPE "xz")
diff --git a/src/radiotray-ng/extras/scripts/rt2rtng b/src/radiotray-ng/extras/scripts/rt2rtng
index 66f1c2e..2bf53ba 100755
--- a/src/radiotray-ng/extras/scripts/rt2rtng
+++ b/src/radiotray-ng/extras/scripts/rt2rtng
@@ -1,6 +1,6 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
 #
-# Copyright 2017 Edward G. Bruck <ed.bruck1@gmail.com>
+# Copyright 2017-2019 Edward G. Bruck <ed.bruck1@gmail.com>
 #
 # This file is part of Radiotray-NG.
 #
@@ -43,7 +43,7 @@ def walk_bookmarks(root, group_func, bookmark_func, group=""):
 
 def group_callback(group_name):
     if len(bookmarks):
-        if not bookmarks[0].has_key(group_name):
+        if group_name not in bookmarks[0]:
             bookmarks.append({'group' : group_name, 'image' : '', 'stations' : [] })
     else:
         bookmarks.append({'group' : group_name, 'image' : '', 'stations' : [] })
@@ -74,13 +74,13 @@ def prune_empty_groups():
 
 if __name__ == "__main__":
     if len(sys.argv) != 2:
-        print "usage: rt2rtng <path to radiotray bookmarks.xml>"
+        print("usage: rt2rtng <path to radiotray bookmarks.xml>")
         exit(1)
 
     if os.path.exists(sys.argv[1]):
         root = etree.parse(sys.argv[1]).getroot()
         walk_bookmarks(root, group_callback, bookmark_callback)
         prune_empty_groups()        
-        print json.dumps(bookmarks, indent=4)
+        print(json.dumps(bookmarks, indent=4))
     else:
-        print sys.argv[1], "not found!"
+        print(sys.argv[1], "not found!")