<s> from __future__ import unicode_literals <EOL> import logging <EOL> from warnings import warn <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from djblets . configforms . mixins import DynamicConfigPageMixin <EOL> from djblets . configforms . pages import ConfigPage <EOL> from djblets . configforms . registry import ConfigPageRegistry <EOL> from djblets . registries . errors import ItemLookupError <EOL> from djblets . registries . mixins import ExceptionFreeGetterMixin <EOL> from reviewboard . accounts . forms . pages import ( AccountSettingsForm , <EOL> APITokensForm , <EOL> ChangePasswordForm , <EOL> ProfileForm , <EOL> GroupsForm ) <EOL> class AccountPageRegistry ( ExceptionFreeGetterMixin , ConfigPageRegistry ) : <EOL> """<STR_LIT>""" <EOL> lookup_attrs = ( '<STR_LIT>' , ) <EOL> def get_defaults ( self ) : <EOL> """<STR_LIT>""" <EOL> return ( GroupsPage , AccountSettingsPage , AuthenticationPage , <EOL> ProfilePage , APITokensPage ) <EOL> def unregister ( self , page_class ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> super ( AccountPageRegistry , self ) . unregister ( page_class ) <EOL> except ItemLookupError as e : <EOL> logging . error ( e ) <EOL> raise e <EOL> class AccountPage ( DynamicConfigPageMixin , ConfigPage ) : <EOL> """<STR_LIT>""" <EOL> registry = AccountPageRegistry ( ) <EOL> class AccountSettingsPage ( AccountPage ) : <EOL> """<STR_LIT>""" <EOL> page_id = '<STR_LIT>' <EOL> page_title = _ ( '<STR_LIT>' ) <EOL> form_classes = [ AccountSettingsForm ] <EOL> class APITokensPage ( AccountPage ) : <EOL> """<STR_LIT>""" <EOL> page_id = '<STR_LIT>' <EOL> page_title = _ ( '<STR_LIT>' ) <EOL> form_classes = [ APITokensForm ] <EOL> class AuthenticationPage ( AccountPage ) : <EOL> """<STR_LIT>""" <EOL> page_id = '<STR_LIT>' <EOL> page_title = _ ( '<STR_LIT>' ) <EOL> form_classes = [ ChangePasswordForm ] <EOL> class ProfilePage ( AccountPage ) : <EOL> """<STR_LIT>""" <EOL> page_id = '<STR_LIT>' <EOL> page_title = _ ( '<STR_LIT>' ) <EOL> form_classes = [ ProfileForm ] <EOL> class GroupsPage ( AccountPage ) : <EOL> """<STR_LIT>""" <EOL> page_id = '<STR_LIT>' <EOL> page_title = _ ( '<STR_LIT>' ) <EOL> form_classes = [ GroupsForm ] <EOL> def register_account_page_class ( cls ) : <EOL> """<STR_LIT>""" <EOL> warn ( '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> DeprecationWarning ) <EOL> AccountPage . registry . register ( cls ) <EOL> def unregister_account_page_class ( page_cls ) : <EOL> """<STR_LIT>""" <EOL> warn ( '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> DeprecationWarning ) <EOL> AccountPage . registry . unregister ( page_cls ) <EOL> def get_page_class ( page_id ) : <EOL> """<STR_LIT>""" <EOL> warn ( '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> DeprecationWarning ) <EOL> return AccountPage . registry . get ( '<STR_LIT>' , page_id ) <EOL> def get_page_classes ( ) : <EOL> """<STR_LIT>""" <EOL> warn ( '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> DeprecationWarning ) <EOL> return iter ( AccountPage . registry ) </s>
