#NEWLINE# def _update_attributes( self , branch ) : #NEWLINE# #INDENT# self . name = branch . get ( 'name' ) #NEWLINE# self . commit = branch . get ( 'commit' ) #NEWLINE# if self . commit : #NEWLINE# #INDENT# self . commit = RepoCommit ( self . commit , self ) #NEWLINE# #UNINDENT# self . links = branch . get ( '_links' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . protection = branch . get ( 'protection' ) #NEWLINE# if ( 'self' in self . links ) : #NEWLINE# #INDENT# self . _api = self . links [ 'self' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# base = self . commit . url . split ( '/commit' , 1 ) [ 0 ] #NEWLINE# self . _api = self . _build_url ( 'branches' , self . name , base_url = base )