From 88da95e30aa7731b9ec309988c41684eb4b9dccb Mon Sep 17 00:00:00 2001 From: M0Rf30 Date: Sun, 17 Mar 2019 17:17:32 +0100 Subject: [PATCH] using python3 --- Dockerfile | 2 +- GMusicProxy | 12 ++++++------ README.md | 6 +++--- setup.py | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index f28234d..3105db2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:2.7 +FROM python:3 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app diff --git a/GMusicProxy b/GMusicProxy index 43153f2..e9d81c7 100755 --- a/GMusicProxy +++ b/GMusicProxy @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Google Play Music Proxy © Mario Di Raimondo < mario.diraimondo (at) gmail.com > @@ -31,7 +31,7 @@ try: # Python 2 from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from urlparse import urlparse, parse_qs from urllib2 import URLError, build_opener - from ConfigParser import SafeConfigParser + from ConfigParser import ConfigParser from StringIO import StringIO from SocketServer import ThreadingMixIn except ImportError: # Python 3 @@ -39,7 +39,7 @@ except ImportError: # Python 3 from urllib.error import URLError from urllib.request import build_opener from http.server import HTTPServer, BaseHTTPRequestHandler - from configparser import SafeConfigParser + from configparser import ConfigParser from io import StringIO from socketserver import ThreadingMixIn @@ -814,13 +814,13 @@ def getOptions(filename): parser.add_argument( '--keyring-entry', help='keyring entry to use, required if --keyring-service is used') - config = SafeConfigParser() + config = ConfigParser() args = parser.parse_args() fp = StringIO('[dummy]\n') - config.readfp(fp) + config.read_file(fp) if args.config: fp = StringIO('[dummy]\n' + args.config.read()) - config.readfp(fp) + config.read_file(fp) else: for path in reversed(list(xdg.BaseDirectory.load_config_paths(filename))): fp = StringIO('[dummy]\n' + open(path, 'r').read()) diff --git a/README.md b/README.md index 0de430b..53ce302 100644 --- a/README.md +++ b/README.md @@ -129,13 +129,13 @@ Feel free to open [bug reports][4] (complete of verbose output produced with opt ## Setup ### Requirements - a Google Play Music account with All Access subscription (some functionalities continue to work even with a free account) -- a **Python** 2.7 interpreter (experimental support for **Python** 3 is included) +- a **Python** interpreter - some python libs: *gmusicapi*, *netifaces*, *pyxdg*, *eyed3*, *python-daemon* ### Installation The following instructions have a Debian/Ubuntu GNU/Linux system as reference: nevertheless they work on any other GNU/Linux system using the right substitute of `apt-get`. It is known to work also on Mac OS X and Windows systems. -In order to build some dependencies, you need for sure a working building system with `sudo apt-get install build-essential python2.7-dev`. It could be useful to add some necessary packages: `sudo apt-get install libffi-dev libssl-dev`. +In order to build some dependencies, you need for sure a working building system with `sudo apt-get install build-essential python3.7-dev`. It could be useful to add some necessary packages: `sudo apt-get install libffi-dev libssl-dev`. - The easiest way, but not suggested, is to use the `pip` command to install the proxy with all the dependencies from PyPI and GitHub repositories: @@ -155,7 +155,7 @@ In order to build some dependencies, you need for sure a working building system ```bash sudo apt-get install python-pip python-virtualenv virtualenvwrapper - mkvirtualenv -p /usr/bin/python2 gmusicproxy + mkvirtualenv -p /usr/bin/python3 gmusicproxy git clone https://github.com/diraimondo/gmusicproxy.git cd gmusicproxy pip install -r requirements.txt diff --git a/setup.py b/setup.py index ca5a086..7d5f77d 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re