#NEWLINE# def __init__( self , parent = None ) : #NEWLINE# #INDENT# super ( GithubCredentialsWizardPage , self ) . __init__ ( parent , title = 'Credentials' , subTitle = 'Enter your username/password or token' ) #NEWLINE# self . userPassRadioButton = QRadioButton ( ) #NEWLINE# self . userPassRadioButton . toggled . connect ( self . changeMode ) #NEWLINE# self . userPassRadioButton . toggled . connect ( self . completeChanged . emit ) #NEWLINE# self . tokenRadioButton = QRadioButton ( ) #NEWLINE# self . tokenRadioButton . toggled . connect ( self . changeMode ) #NEWLINE# self . tokenRadioButton . toggled . connect ( self . completeChanged . emit ) #NEWLINE# self . usernameEdit = QLineEdit ( textChanged = self . completeChanged . emit ) #NEWLINE# self . usernameEdit . setValidator ( QRegExpValidator ( QRegExp ( '[A-Za-z\\d]+[A-Za-z\\d-]+' ) ) ) #NEWLINE# self . passwordEdit = QLineEdit ( textChanged = self . completeChanged . emit ) #NEWLINE# self . passwordEdit . setValidator ( QRegExpValidator ( QRegExp ( '.+' ) ) ) #NEWLINE# self . passwordEdit . setEchoMode ( QLineEdit . Password ) #NEWLINE# self . tokenEdit = QLineEdit ( textChanged = self . completeChanged . emit ) #NEWLINE# self . tokenEdit . setValidator ( QRegExpValidator ( QRegExp ( '[A-Za-z\\d]+' ) ) ) #NEWLINE# self . tokenEdit . setEchoMode ( QLineEdit . Password ) #NEWLINE# form = QFormLayout ( ) #NEWLINE# form . addRow ( '<b>username/password</b>' , self . userPassRadioButton ) #NEWLINE# form . addRow ( 'username: ' , self . usernameEdit ) #NEWLINE# form . addRow ( 'password: ' , self . passwordEdit ) #NEWLINE# form . addRow ( '<b>token</b>' , self . tokenRadioButton ) #NEWLINE# form . addRow ( 'token: ' , self . tokenEdit ) #NEWLINE# self . mainLayout = QVBoxLayout ( ) #NEWLINE# self . mainLayout . addLayout ( form ) #NEWLINE# self . setLayout ( self . mainLayout ) #NEWLINE# self . registerField ( 'username' , self . usernameEdit ) #NEWLINE# self . registerField ( 'password' , self . passwordEdit ) #NEWLINE# self . registerField ( 'token' , self . tokenEdit ) #NEWLINE# self . userPassRadioButton . toggle ( ) #NEWLINE# self . require_2fa = False