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

Commit

Permalink
fixes #7 - use default interface for uploader id
Browse files Browse the repository at this point in the history
Signed-off-by: Jay MOULIN <[email protected]>
  • Loading branch information
jaymoulin committed Mar 30, 2018
1 parent 3c347a8 commit 4f656d3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
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.3'
__version__ = '1.0.0'

setup(
name='google_music_manager_auth',
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.3'
__version__ = '1.0.0'

setup(
name='google_music_manager_downloader',
Expand Down
7 changes: 4 additions & 3 deletions uploader/google_music_manager_uploader/uploader_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

__all__ = ['upload']

__DEFAULT_IFACE__ = netifaces.gateways()['default'][netifaces.AF_INET][1]
__DEFAULT_MAC__ = netifaces.ifaddresses(__DEFAULT_IFACE__)[netifaces.AF_LINK][0]['addr'].upper()

class MusicToUpload(FileSystemEventHandler):
def on_created(self, event):
Expand All @@ -28,8 +30,7 @@ def on_created(self, event):
os.remove(event.src_path)


def upload(directory='.', oauth=os.environ['HOME'] + '/oauth', remove=False,
uploader_id=netifaces.ifaddresses('eth0')[netifaces.AF_LINK][0]['addr'].upper()):
def upload(directory='.', oauth=os.environ['HOME'] + '/oauth', remove=False, uploader_id=__DEFAULT_MAC__):
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger.info("Init Daemon - Press Ctrl+C to quit")
Expand Down Expand Up @@ -68,7 +69,7 @@ def main():
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(),
default=__DEFAULT_MAC__,
help="Uploader identification (should be an uppercase MAC address) (default: <current eth0 MAC address>)")
args = parser.parse_args()
upload(args.directory, args.oauth, args.remove, args.uploader_id)
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.3'
__version__ = '1.0.0'

setup(
name='google_music_manager_uploader',
Expand Down

0 comments on commit 4f656d3

Please sign in to comment.