Skip to content

Commit

Permalink
Corrected use of 'lowercase' and 'uppercase' to fix web2py#1515
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelbandito committed Oct 28, 2016
1 parent 6d38aa7 commit 4226b6d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions applications/admin/languages/nl.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@
'modules': 'modules',
'Multi User Mode': 'Multi User Mode',
'Must include at least %s %s': 'Moet ten minste bevatten %s %s',
'Must include at least %s lower case': 'Moet ten minste bevatten %s lower case',
'Must include at least %s lowercase': 'Moet ten minste bevatten %s kleine letter',
'Must include at least %s of the following : %s': 'Moet ten minste bevatten %s van het volgende : %s',
'Must include at least %s upper case': 'Moet ten minste bevatten %s upper case',
'Must include at least %s uppercase': 'Moet ten minste bevatten %s hoofdletter',
'new application "%s" created': 'nieuwe applicatie "%s" gemaakt',
'new application "%s" imported': 'new application "%s" imported',
'New Application Wizard': 'Nieuwe Applicatie Wizard',
Expand Down
4 changes: 2 additions & 2 deletions applications/admin/languages/uk.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@
'modules': 'модулі',
'Multi User Mode': 'Multi User Mode',
'Must include at least %s %s': 'Має вміщувати щонайменше %s %s',
'Must include at least %s lower case': 'Повинен включати щонайменше %s малих букв',
'Must include at least %s lowercase': 'Повинен включати щонайменше %s малих букв',
'Must include at least %s of the following : %s': 'Має включати не менше %s таких символів : %s',
'Must include at least %s upper case': 'Повинен включати щонайменше %s великих букв',
'Must include at least %s uppercase': 'Повинен включати щонайменше %s великих букв',
'new application "%s" created': 'новий додаток "%s" створено',
'new application "%s" imported': 'new application "%s" imported',
'New Application Wizard': 'Майстер створення нового додатку',
Expand Down
6 changes: 3 additions & 3 deletions applications/admin/static/codemirror/keymap/vim.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@
// Vim does not support modifier only keys.
return false;
}
// TODO: Current bindings expect the character to be lower case, but
// it looks like vim key notation uses upper case.
// TODO: Current bindings expect the character to be lowercase, but
// it looks like vim key notation uses uppercase.
if (isUpperCase(lastPiece)) {
pieces[pieces.length - 1] = lastPiece.toLowerCase();
}
Expand Down Expand Up @@ -3644,7 +3644,7 @@
* Extract the regular expression from the query and return a Regexp object.
* Returns null if the query is blank.
* If ignoreCase is passed in, the Regexp object will have the 'i' flag set.
* If smartCase is passed in, and the query contains upper case letters,
* If smartCase is passed in, and the query contains uppercase letters,
* then ignoreCase is overridden, and the 'i' flag will not be set.
* If the query contains the /i in the flag part of the regular expression,
* then both ignoreCase and smartCase are ignored, and 'i' will be passed
Expand Down
8 changes: 4 additions & 4 deletions gluon/tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,24 +843,24 @@ def test_IS_STRONG(self):
'|'.join(['Minimum length is 8',
'Maximum length is 4',
'Must include at least 1 of the following: ~!@#$%^&*()_+-=?<>,.:;{}[]|',
'Must include at least 1 upper case',
'Must include at least 1 uppercase',
'Must include at least 1 number']))
)
rtn = IS_STRONG(es=True)('abcde')
self.assertEqual(rtn,
('abcde',
'|'.join(['Minimum length is 8',
'Must include at least 1 of the following: ~!@#$%^&*()_+-=?<>,.:;{}[]|',
'Must include at least 1 upper case',
'Must include at least 1 uppercase',
'Must include at least 1 number']))
)
rtn = IS_STRONG(upper=0, lower=0, number=0, es=True)('Abcde1')
self.assertEqual(rtn,
('Abcde1',
'|'.join(['Minimum length is 8',
'Must include at least 1 of the following: ~!@#$%^&*()_+-=?<>,.:;{}[]|',
'May not include any upper case letters',
'May not include any lower case letters',
'May not include any uppercase letters',
'May not include any lowercase letters',
'May not include any numbers']))
)

Expand Down
12 changes: 6 additions & 6 deletions gluon/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,7 @@ def __call__(self, value):

class IS_LOWER(Validator):
"""
Converts to lower case::
Converts to lowercase::
>>> IS_LOWER()('ABC')
('abc', None)
Expand All @@ -2485,7 +2485,7 @@ def __call__(self, value):

class IS_UPPER(Validator):
"""
Converts to upper case::
Converts to uppercase::
>>> IS_UPPER()('abc')
('ABC', None)
Expand Down Expand Up @@ -3025,22 +3025,22 @@ def __call__(self, value):
all_upper = re.findall("[A-Z]", value)
if self.upper > 0:
if not len(all_upper) >= self.upper:
failures.append(translate("Must include at least %s upper case")
failures.append(translate("Must include at least %s uppercase")
% str(self.upper))
else:
if len(all_upper) > 0:
failures.append(
translate("May not include any upper case letters"))
translate("May not include any uppercase letters"))
if isinstance(self.lower, int):
all_lower = re.findall("[a-z]", value)
if self.lower > 0:
if not len(all_lower) >= self.lower:
failures.append(translate("Must include at least %s lower case")
failures.append(translate("Must include at least %s lowercase")
% str(self.lower))
else:
if len(all_lower) > 0:
failures.append(
translate("May not include any lower case letters"))
translate("May not include any lowercase letters"))
if isinstance(self.number, int):
all_number = re.findall("[0-9]", value)
if self.number > 0:
Expand Down

0 comments on commit 4226b6d

Please sign in to comment.