forked from stroem/spotify-deamon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
executable file
·38 lines (30 loc) · 888 Bytes
/
client.py
File metadata and controls
executable file
·38 lines (30 loc) · 888 Bytes
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
#!/usr/bin/env python
############################
## Remove *.pyc files
############################
import os
def remove_pyc(dir = '.'):
directory = os.listdir(dir)
for file in directory:
path = dir + '/' + file
if os.path.isdir(path) and file not in ['.', '..']:
remove_pyc(path)
elif file[-4:] == '.pyc':
os.remove(path)
############################
## MAIN
############################
import optparse
#from src.sessionmanager import SessionManager
from src.sessionmanager import *
op = optparse.OptionParser(version="%prog 0.1")
op.add_option("-u", "--username", help="spotify username")
op.add_option("-p", "--password", help="spotify password")
(options, args) = op.parse_args()
if not options.username or not options.password:
op.print_help()
remove_pyc()
raise SystemExit
s = SessionManager(options.username, options.password)
s.connect()
remove_pyc()