コード例 #1
0
        def btnRegister(btn):
            def isLoginLegal(username, password):
                if len(username) > 3 and len(password) > 3:
                    return True
                else:
                    alertMessageDialog(msg='La salutnomo kaj pasvorto devas esti pli longa ol 3 karaktroj', title='Eraro okazis')

            def isStringLegal(string):
                restricted = u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ĉĈĝĜĥĤĵĴŝŜŭŬ'

                for i in range(len(string)):
                    if string[i] not in restricted:
                        # todo: msgbox (not valid)
                        alertMessageDialog(msg=u'La nomo nevalidas. Ĝi devas enhavi nur tiujn karaktrojn: [a-z], [ĉĝĥĵŝŭ], kaj [0-9].', title='Eraro okazis')
                        return False

                return True

            def checkPasswords(password1, password2):
                if password1 == password2:
                    return True


            username = self.value.items()[0][1]
            password = self.value.items()[1][1]
            passwordConfirm = self.value.items()[2][1]

            if isLoginLegal(username, password):
                if checkPasswords(password, passwordConfirm):
                    if isStringLegal(username):
                        g.tcpConn.sendNewAccount(username, password)

                else:
                    # todo: msgbox
                    alertMessageDialog(msg='La pasvortoj ne kongruas.', title='Eraro okazis')
コード例 #2
0
        def btnRegister(btn):
            def isLoginLegal(username, password):
                if len(username) > 3 and len(password) > 3:
                    return True
                else:
                    alertMessageDialog(msg='Username and password must be larger than 3 characters.', title='An error occured')

            def isStringLegal(string):
                restricted = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

                for i in range(len(string)):
                    if string[i] not in restricted:
                        # todo: msgbox (not valid)
                        alertMessageDialog(msg='The name is not valid! The name may only contain a-z and 0-9.', title='An error occured')
                        return False

                return True

            def checkPasswords(password1, password2):
                if password1 == password2:
                    return True


            username = self.value.items()[0][1]
            password = self.value.items()[1][1]
            passwordConfirm = self.value.items()[2][1]

            if isLoginLegal(username, password):
                if checkPasswords(password, passwordConfirm):
                    if isStringLegal(username):
                        g.tcpConn.sendNewAccount(username, password)

                else:
                    # todo: msgbox
                    alertMessageDialog(msg='The passwords don\'t match.', title='An error occured')
コード例 #3
0
        def btnRegister(btn):
            def isLoginLegal(username, password):
                if len(username) > 3 and len(password) > 3:
                    return True
                else:
                    alertMessageDialog(msg='Username and password must be larger than 3 characters.', title='An error occured')

            def isStringLegal(string):
                restricted = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

                for i in range(len(string)):
                    if string[i] not in restricted:
                        # todo: msgbox (not valid)
                        alertMessageDialog(msg='The name is not valid! The name may only contain a-z and 0-9.', title='An error occured')
                        return False

                return True

            def checkPasswords(password1, password2):
                if password1 == password2:
                    return True


            username = self.value.items()[0][1]
            password = self.value.items()[1][1]
            passwordConfirm = self.value.items()[2][1]

            if isLoginLegal(username, password):
                if checkPasswords(password, passwordConfirm):
                    if isStringLegal(username):
                        g.tcpConn.sendNewAccount(username, password)

                else:
                    # todo: msgbox
                    alertMessageDialog(msg='The passwords don\'t match.', title='An error occured')
コード例 #4
0
 def isLoginLegal(username, password):
     if len(username) > 3 and len(password) > 3:
         return True
     else:
         alertMessageDialog(
             msg=
             'Username and password must be larger than 3 characters.',
             title='An error occured')
コード例 #5
0
    def isStringLegal(self, string):
        restricted = u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ĉĈĝĜĥĤĵĴŝŜŭŬ'

        for i in range(len(string)):
            if string[i] not in restricted:
                alertMessageDialog(msg=_(u'La nomo nevalidas. Ĝi devas enhavi nur tiujn karaktrojn: [a-z], [ĉĝĥĵŝŭ], kaj [0-9].'), title=_('Eraro okazis'))
                return False

        return True
コード例 #6
0
ファイル: menunewchar.py プロジェクト: Delsy/pyorpg-client
    def isStringLegal(self, string):
        restricted = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

        for i in range(len(string)):
            if string[i] not in restricted:
                alertMessageDialog(msg='The name is not valid! The name may only contain a-z and 0-9.', title='An error occured')
                return False

        return True
コード例 #7
0
ファイル: client.py プロジェクト: Waterseas/pyorpg-client
 def clientConnectionFailed(self, connector, reason):
     errorMsg = reason.getErrorMessage().split(':')
     alertMessageDialog('Unable to connect to server: ' + errorMsg[1] + errorMsg[2], 'An error occured')
     print reason.getErrorMessage()
コード例 #8
0
 def isLoginLegal(username, password):
     if len(username) > 3 and len(password) > 3:
         return True
     else:
         alertMessageDialog(msg='La salutnomo kaj pasvorto devas esti pli longa ol 3 karaktroj', title='Eraro okazis')
コード例 #9
0
 def isLoginLegal(username, password):
     if len(username) > 3 and len(password) > 3:
         return True
     else:
         alertMessageDialog(msg='Username and password must be larger than 3 characters.', title='An error occured')
コード例 #10
0
ファイル: datahandler.py プロジェクト: ellmo/pyorpg-client
    def handleAlertMsg(self, jsonData):
        msg = jsonData[0]['msg']

        alertMessageDialog(msg=msg)
コード例 #11
0
    def handleAlertMsg(self, jsonData):
        msg = jsonData[0]['msg']

        alertMessageDialog(msg=msg)
コード例 #12
0
ファイル: client.py プロジェクト: wty0512/pyorpg-client
 def clientConnectionFailed(self, connector, reason):
     errorMsg = reason.getErrorMessage().split(':')
     alertMessageDialog('Unable to connect to server: ' + errorMsg[1] + errorMsg[2], 'An error occured')
     print reason.getErrorMessage()
コード例 #13
0
ファイル: datahandler.py プロジェクト: Irtorius/pyorpg-client
    def handleAlertMsg(self, jsonData):
        msg = jsonData[0]['msg']
        creatingAccount = 'Your account has been created!'

        alertMessageDialog(msg=msg)
コード例 #14
0
ファイル: datahandler.py プロジェクト: Irtorius/pyorpg-client
    def handleAlertMsg(self, jsonData):
        msg = jsonData[0]['msg']
        creatingAccount = 'Your account has been created!'

        alertMessageDialog(msg=msg)