Module Expr Str Assign NameStore ListLoad Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Expr Yield Call AttributeLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad attr decorator_list NameLoad AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryFinally body Expr Yield Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Yield Call AttributeLoad NameLoad attr Expr Yield Call AttributeLoad NameLoad attr Expr Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Yield Call AttributeLoad NameLoad attr finalbody Expr Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr If BoolOpOr CompareIs AttributeLoad NameLoad attr NameLoad UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr NameStore Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If CompareIsNot NameLoad NameLoad body If Call AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad Str Assign TupleStore NameStore NameStore Yield ListLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad Str If Call AttributeLoad NameLoad attr body Raise Call NameLoad Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr If CompareIs AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Dict If CompareIn Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr If CompareIn Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str AttributeLoad NameLoad attr Expr Yield Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Dict decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Expr Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assert CompareNotIn Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Yield Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Expr Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Expr Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Expr Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr decorator_list
N/A N/A Viewfinder UpdateViewpointOperation.

This operation updates viewpoint metadata.
 N/A __authors__ N/A andy@emailscrubbed.com (Andy Kimball) N/A json tornado gen viewfinder.backend.base util viewfinder.backend.base.exceptions InvalidRequestError PermissionError viewfinder.backend.db.accounting AccountingAccumulator viewfinder.backend.db.db_client DBKey viewfinder.backend.db.episode Episode viewfinder.backend.db.follower Follower viewfinder.backend.db.operation Operation viewfinder.backend.db.post Post viewfinder.backend.db.viewpoint Viewpoint viewfinder.backend.op.notification_manager NotificationManager viewfinder.backend.op.viewfinder_op ViewfinderOperation UpdateViewpointOperation N/A ViewfinderOperation N/A N/A The UpdateViewpoint operation follows the four phase pattern described in the header of
  operation_map.py.
   __init__ N/A N/A self client act_dict user_id vp_dict N/A N/A N/A N/A N/A N/A super UpdateViewpointOperation self __init__ client N/A N/A self _act_dict act_dict N/A N/A self _user_id user_id N/A N/A self _vp_dict vp_dict N/A N/A self _viewpoint_id N/A vp_dict N/A viewpoint_id N/A Execute N/A N/A cls client activity user_id viewpoint N/A N/A N/A Entry point called by the operation framework. N/A N/A N/A N/A N/A UpdateViewpointOperation client activity user_id viewpoint _UpdateViewpoint N/A classmethod N/A gen coroutine _UpdateViewpoint N/A N/A self N/A N/A N/A Orchestrates the update viewpoint operation by executing each of the phases in turn. N/A lock N/A N/A N/A gen Task N/A Viewpoint AcquireLock N/A self _client N/A self _viewpoint_id N/A N/A N/A N/A N/A N/A self _Check N/A N/A N/A N/A self _client CheckDBNotModified N/A N/A N/A N/A self _Update N/A N/A N/A N/A self _Account N/A N/A N/A N/A Operation TriggerFailpoint N/A self _client N/A N/A N/A N/A self _Notify N/A N/A N/A N/A N/A gen Task N/A Viewpoint ReleaseLock N/A self _client N/A self _viewpoint_id lock N/A N/A gen coroutine _Check N/A N/A self N/A N/A N/A Gathers pre-mutation information:
       1. Queries for existing followers and viewpoint.
       2. Checkpoints list of followers that need to be revived.

       Validates the following:
       1. Permission to update viewpoint metadata.
     N/A N/A N/A self _viewpoint N/A self _follower N/A N/A N/A gen Task N/A Viewpoint QueryWithFollower N/A self _client N/A self _user_id N/A self _viewpoint_id N/A N/A N/A self _viewpoint None N/A N/A N/A InvalidRequestError N/A Viewpoint "%s" does not exist and so cannot be updated. N/A self _viewpoint_id N/A N/A N/A N/A self _follower None N/A N/A N/A N/A self _follower CanContribute N/A N/A N/A PermissionError N/A User %d does not have permission to update viewpoint "%s". N/A N/A self _user_id N/A self _viewpoint_id N/A N/A N/A self _followers _ N/A N/A N/A gen Task N/A Viewpoint QueryFollowers N/A self _client N/A self _viewpoint_id limit N/A Viewpoint MAX_FOLLOWERS N/A cover_photo N/A N/A N/A self _vp_dict get cover_photo None N/A N/A cover_photo None N/A N/A N/A N/A N/A self _viewpoint IsDefault N/A N/A N/A InvalidRequestError A cover photo cannot be set on your library. N/A N/A cover_photo_episode cover_photo_post N/A N/A N/A N/A gen Task N/A Episode Query N/A self _client N/A cover_photo N/A episode_id None must_exist False N/A N/A gen Task N/A Post Query N/A self _client N/A cover_photo N/A episode_id N/A cover_photo N/A photo_id None must_exist False N/A N/A cover_photo_post None N/A N/A N/A InvalidRequestError The requested cover photo does not exist. N/A N/A N/A cover_photo_post IsUnshared N/A N/A N/A PermissionError The requested cover photo has been unshared. N/A N/A N/A cover_photo_episode viewpoint_id N/A self _viewpoint_id N/A N/A N/A InvalidRequestError N/A The requested cover photo is not in viewpoint "%s". N/A self _viewpoint_id N/A N/A N/A N/A self _op checkpoint None N/A N/A N/A self _revive_follower_ids N/A N/A self _GetRevivableFollowers N/A self _followers N/A N/A self _prev_values N/A N/A N/A title N/A self _vp_dict N/A N/A N/A N/A util SetIfNotNone N/A self _prev_values prev_title N/A N/A self _viewpoint title N/A N/A cover_photo N/A self _vp_dict N/A N/A N/A N/A util SetIfNotNone N/A self _prev_values prev_cover_photo N/A N/A self _viewpoint cover_photo N/A checkpoint N/A revive N/A self _revive_follower_ids N/A N/A N/A util SetIfNotEmpty checkpoint prev N/A self _prev_values N/A N/A N/A N/A N/A self _op SetCheckpoint N/A self _client checkpoint N/A N/A N/A self _revive_follower_ids N/A N/A N/A self _op checkpoint N/A revive N/A N/A self _prev_values N/A N/A N/A N/A self _op checkpoint get prev N/A N/A N/A gen coroutine _Update N/A N/A self N/A N/A N/A Updates the database:
       1. Revives any followers that have removed the viewpoint.
       2. Updates the viewpoint metadata.
     N/A N/A N/A N/A gen Task N/A Follower ReviveRemovedFollowers N/A self _client N/A self _followers N/A N/A update_seq N/A self _vp_dict N/A self _vp_dict N/A N/A N/A N/A self _viewpoint UpdateFromKeywords N/A self _vp_dict N/A N/A N/A N/A gen Task N/A N/A self _viewpoint Update N/A self _client N/A N/A gen coroutine _Account N/A N/A self N/A N/A N/A Makes accounting changes:
       1. For revived followers.
     N/A acc_accum N/A AccountingAccumulator N/A N/A N/A N/A acc_accum ReviveFollowers N/A self _client N/A self _viewpoint_id N/A self _revive_follower_ids N/A N/A N/A N/A acc_accum Apply N/A self _client N/A N/A gen coroutine _Notify N/A N/A self N/A N/A N/A Creates notifications:
       1. Notifies removed followers that conversation has new activity.
       2. Notifies existing followers of the viewpoint that metadata has changed.
     N/A N/A N/A N/A NotificationManager NotifyReviveFollowers N/A self _client N/A self _viewpoint_id N/A self _revive_follower_ids N/A N/A self _op timestamp N/A N/A N/A N/A NotificationManager NotifyUpdateViewpoint N/A self _client N/A self _vp_dict N/A self _followers N/A self _prev_values N/A self _act_dict N/A N/A gen coroutine N/A