Skip to content

Commit

Permalink
using python3
Browse files Browse the repository at this point in the history
  • Loading branch information
M0Rf30 committed Mar 17, 2019
1 parent 180f829 commit 88da95e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:2.7
FROM python:3

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
Expand Down
12 changes: 6 additions & 6 deletions GMusicProxy
Original file line number Diff line number Diff line change
@@ -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 >
Expand Down Expand Up @@ -31,15 +31,15 @@ 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
from urllib.parse import urlparse, parse_qs
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

Expand Down Expand Up @@ -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())
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import re
Expand Down

0 comments on commit 88da95e

Please sign in to comment.