Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
fixes #5 - oauth relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Mar 20, 2018
1 parent 736d402 commit c2a48ad
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions auth/google_music_manager_auth/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

# Usage ./auth.py [path_to_oauth_cred_file=~/oauth]

import sys
import sys, os
from gmusicapi import Musicmanager

__all__ = ['auth']


def auth(auth_file='~/oauth'):
def auth(auth_file=os.environ['HOME'] + '/oauth'):
api = Musicmanager()
if api.perform_oauth(auth_file):
print("Logged successfully")


def main():
auth(sys.argv[1] if len(sys.argv) > 1 else '~/oauth')
auth(sys.argv[1] if len(sys.argv) > 1 else os.environ['HOME'] + '/oauth')


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion auth/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import setup, find_packages

__version__ = '0.7.2'
__version__ = '0.7.3'

setup(
name='google_music_manager_auth',
Expand Down
6 changes: 3 additions & 3 deletions downloader/google_music_manager_downloader/download.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys, time, logging, os.path, argparse
import sys, time, logging, os.path, argparse, os
from gmusicapi import Musicmanager

__all__ = ['download']


def download(directory=".", oauth="~/oauth"):
def download(directory=".", oauth=os.environ['HOME'] + "/oauth"):
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger.info("Init Daemon - Press Ctrl+C to quit")
Expand All @@ -32,7 +32,7 @@ def download(directory=".", oauth="~/oauth"):
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--directory", '-d', default='.', help="Music Folder to download to (default: .)")
parser.add_argument("--oauth", '-a', default='~/oauth', help="Path to oauth file (default: ~/oauth)")
parser.add_argument("--oauth", '-a', default=os.environ['HOME'] + '/oauth', help="Path to oauth file (default: ~/oauth)")
args = parser.parse_args()
download(args.directory, args.oauth)

Expand Down
2 changes: 1 addition & 1 deletion downloader/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import setup, find_packages

__version__ = '0.7.2'
__version__ = '0.7.3'

setup(
name='google_music_manager_downloader',
Expand Down
4 changes: 2 additions & 2 deletions uploader/google_music_manager_uploader/uploader_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def on_created(self, event):
os.remove(event.src_path)


def upload(directory='.', oauth='~/oauth', remove=False,
def upload(directory='.', oauth=os.environ['HOME'] + '/oauth', remove=False,
uploader_id=netifaces.ifaddresses('eth0')[netifaces.AF_LINK][0]['addr'].upper()):
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -65,7 +65,7 @@ def upload(directory='.', oauth='~/oauth', remove=False,
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--directory", '-d', default='.', help="Music Folder to upload from (default: .)")
parser.add_argument("--oauth", '-a', default='~/oauth', help="Path to oauth file (default: ~/oauth)")
parser.add_argument("--oauth", '-a', default=os.environ['HOME'] + '/oauth', help="Path to oauth file (default: ~/oauth)")
parser.add_argument("-r", "--remove", action='store_true', help="Remove files if present (default: False)")
parser.add_argument("--uploader_id", '-u',
default=netifaces.ifaddresses('eth0')[netifaces.AF_LINK][0]['addr'].upper(),
Expand Down
2 changes: 1 addition & 1 deletion uploader/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import setup, find_packages

__version__ = '0.7.2'
__version__ = '0.7.3'

setup(
name='google_music_manager_uploader',
Expand Down

0 comments on commit c2a48ad

Please sign in to comment.