Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
raise NotImplementedError(e)
return type(self)(*self.difference(other))
def __rsub__(self, other) -> 'Scope':
"""Remove scopes from a set."""
if not isinstance(other, (str, scope)):
e = f'Difference not defined for {type(other)} and {type(self)}!'
raise NotImplementedError(e)
return Scope(other) - self
scope.read = Scope(
scope.user_read_email,
scope.user_read_private,
scope.user_top_read,
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.read = Scope(
scope.user_read_email,
scope.user_read_private,
scope.user_top_read,
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write
return type(self)(*self.difference(other))
def __rsub__(self, other) -> 'Scope':
"""Remove scopes from a set."""
if not isinstance(other, (str, scope)):
e = f'Difference not defined for {type(other)} and {type(self)}!'
raise NotImplementedError(e)
return Scope(other) - self
scope.read = Scope(
scope.user_read_email,
scope.user_read_private,
scope.user_top_read,
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write
scope.read = Scope(
scope.user_read_email,
scope.user_read_private,
scope.user_top_read,
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write
def __rsub__(self, other) -> 'Scope':
"""Remove scopes from a set."""
if not isinstance(other, (str, scope)):
e = f'Difference not defined for {type(other)} and {type(self)}!'
raise NotImplementedError(e)
return Scope(other) - self
scope.read = Scope(
scope.user_read_email,
scope.user_read_private,
scope.user_top_read,
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write
scope.user_read_private,
scope.user_top_read,
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write
raise NotImplementedError(e)
return Scope(other) - self
scope.read = Scope(
scope.user_read_email,
scope.user_read_private,
scope.user_top_read,
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write
scope.user_read_email,
scope.user_read_private,
scope.user_top_read,
scope.user_read_recently_played,
scope.user_follow_read,
scope.user_library_read,
scope.user_read_currently_playing,
scope.user_read_playback_state,
scope.user_read_playback_position,
scope.playlist_read_collaborative,
scope.playlist_read_private
)
scope.write = Scope(
scope.user_follow_modify,
scope.user_library_modify,
scope.user_modify_playback_state,
scope.playlist_modify_public,
scope.playlist_modify_private,
scope.ugc_image_upload
)
scope.every = scope.read + scope.write