-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscope_builder.py
More file actions
56 lines (40 loc) · 1.41 KB
/
scope_builder.py
File metadata and controls
56 lines (40 loc) · 1.41 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class ScopeBuilder:
def __init__(self):
self.scopes = []
def listening_history(self):
self.scopes.append('user-read-recently-played')
self.scopes.append('user-top-read')
return self
def library(self):
self.scopes.append('user-library-modify')
self.scopes.append('user-library-read')
return self
def playlists(self):
self.scopes.append('playlist-read-private')
self.scopes.append('playlist-modify-public')
self.scopes.append('playlist-modify-private')
self.scopes.append('playlist-read-collaborative')
return self
def users(self):
self.scopes.append('user-read-email')
self.scopes.append('user-read-birthdate')
self.scopes.append('user-read-private')
return self
def spotify_connect(self):
self.scopes.append('user-read-playback-state')
self.scopes.append('user-modify-playback-state')
self.scopes.append('user-read-currently-playing')
return self
def playback(self):
self.scopes.append('app-remote-control')
self.scopes.append('streaming')
return self
def follow(self):
self.scopes.append('user-follow-read')
self.scopes.append('user-follow-modify')
return self
def get_scopes(self):
ret = ""
for scope in self.scopes:
ret += "%s " % scope
return ret