<s> import wx <EOL> class PasswordDialog ( wx . Dialog ) : <EOL> def __init__ ( self , parent , id , title ) : <EOL> wx . Dialog . __init__ ( self , parent , id ) <EOL> self . SetTitle ( '<STR_LIT>' ) <EOL> if not title : <EOL> title = '<STR_LIT>' <EOL> self . password = None <EOL> sizer = wx . BoxSizer ( wx . VERTICAL ) <EOL> self . SetSizer ( sizer ) <EOL> txt = wx . StaticText ( self , - <NUM_LIT:1> , title ) <EOL> sizer . Add ( txt , <NUM_LIT:1> , wx . EXPAND | wx . ALL , <NUM_LIT:10> ) <EOL> self . passwordEntry = wx . TextCtrl ( self , - <NUM_LIT:1> , style = wx . TE_PASSWORD | wx . TE_PROCESS_ENTER ) <EOL> self . passwordEntry . Bind ( wx . EVT_TEXT_ENTER , self . OnOk ) <EOL> sizer . Add ( self . passwordEntry , <NUM_LIT:0> , wx . EXPAND | wx . ALL , <NUM_LIT:10> ) <EOL> btnSizer = wx . BoxSizer ( wx . HORIZONTAL ) <EOL> sizer . Add ( btnSizer , <NUM_LIT:0> , wx . EXPAND | wx . ALL , <NUM_LIT:10> ) <EOL> btnOk = wx . Button ( self , - <NUM_LIT:1> , '<STR_LIT:OK>' ) <EOL> btnOk . Bind ( wx . EVT_BUTTON , self . OnOk ) <EOL> btnSizer . Add ( btnOk , <NUM_LIT:0> , wx . EXPAND | wx . RIGHT , <NUM_LIT:5> ) <EOL> btnCancel = wx . Button ( self , - <NUM_LIT:1> , '<STR_LIT>' ) <EOL> btnCancel . Bind ( wx . EVT_BUTTON , self . OnCancel ) <EOL> btnSizer . Add ( btnCancel , <NUM_LIT:0> , wx . EXPAND | wx . LEFT , <NUM_LIT:5> ) <EOL> self . Fit ( ) <EOL> def OnOk ( self , e ) : <EOL> self . password = self . passwordEntry . GetValue ( ) <EOL> self . EndModal ( <NUM_LIT:1> ) <EOL> def OnCancel ( self , e ) : <EOL> self . EndModal ( <NUM_LIT:0> ) </s>
