How to use the ttkwidgets.validated_entries.RegexValidator function in ttkwidgets

To help you get started, we’ve selected a few ttkwidgets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TkinterEP / ttkwidgets / tests / test_validatedentries.py View on Github external
def test_multi_validator(self):
        with self.assertRaises(TypeError):
            val = v_entries.AllValidator(v_entries.FloatValidator, int)

        self.assertTrue(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertFalse(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )

        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
github TkinterEP / ttkwidgets / tests / test_validatedentries.py View on Github external
def test_multi_validator(self):
        with self.assertRaises(TypeError):
            val = v_entries.AllValidator(v_entries.FloatValidator, int)

        self.assertTrue(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertFalse(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )

        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
github TkinterEP / ttkwidgets / tests / test_validatedentries.py View on Github external
def test_regex_validator(self):
        self.assertTrue(v_entries.RegexValidator(r'\d')._validate('1'))
        self.assertTrue(v_entries.RegexValidator(r'[a-z]')._validate('a'))
        self.assertFalse(v_entries.RegexValidator(r'[a-z]')._validate('1'))
        self.assertFalse(v_entries.RegexValidator(r'\d')._validate('a'))
github TkinterEP / ttkwidgets / tests / test_validatedentries.py View on Github external
def test_regex_validator(self):
        self.assertTrue(v_entries.RegexValidator(r'\d')._validate('1'))
        self.assertTrue(v_entries.RegexValidator(r'[a-z]')._validate('a'))
        self.assertFalse(v_entries.RegexValidator(r'[a-z]')._validate('1'))
        self.assertFalse(v_entries.RegexValidator(r'\d')._validate('a'))
github TkinterEP / ttkwidgets / tests / test_validatedentries.py View on Github external
self.assertTrue(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertFalse(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )

        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
github TkinterEP / ttkwidgets / tests / test_validatedentries.py View on Github external
self.assertFalse(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )

        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
github TkinterEP / ttkwidgets / tests / test_validatedentries.py View on Github external
def test_multi_validator(self):
        with self.assertRaises(TypeError):
            val = v_entries.AllValidator(v_entries.FloatValidator, int)

        self.assertTrue(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertFalse(
            v_entries.AllValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )

        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
github TkinterEP / ttkwidgets / tests / test_validatedentries.py View on Github external
v_entries.AllValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )

        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'.'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )
        self.assertTrue(
            v_entries.AnyValidator(
                v_entries.RegexValidator(r'[a-z]'),
                v_entries.RegexValidator(r'\d'),
                )._validate('1')
        )