src/eric7/UI/SymbolsWidget.py

branch
eric7
changeset 9539
67a811025fa7
parent 9482
a2bc06a54d9d
child 9653
e67609152c5e
equal deleted inserted replaced
9538:1fce92e31dad 9539:67a811025fa7
439 Private method to check, if a character is a digit. 439 Private method to check, if a character is a digit.
440 440
441 @param char character to test (one character string) 441 @param char character to test (one character string)
442 @return flag indicating a digit (boolean) 442 @return flag indicating a digit (boolean)
443 """ 443 """
444 return unicodedata.category(str(char)) == "Nd" 444 return unicodedata.category(str(char)) in ("Nd", "Nl", "No")
445 445
446 def __isLetter(self, char): 446 def __isLetter(self, char):
447 """ 447 """
448 Private method to check, if a character is a letter. 448 Private method to check, if a character is a letter.
449 449
450 @param char character to test (one character string) 450 @param char character to test (one character string)
451 @return flag indicating a letter (boolean) 451 @return flag indicating a letter (boolean)
452 """ 452 """
453 return unicodedata.category(str(char)) in ["Lu", "Ll", "Lt", "Lm", "Lo"] 453 return unicodedata.category(str(char)) in ("Lu", "Ll", "Lt", "Lm", "Lo")
454 454
455 def __isMark(self, char): 455 def __isMark(self, char):
456 """ 456 """
457 Private method to check, if a character is a mark character. 457 Private method to check, if a character is a mark character.
458 458
459 @param char character to test (one character string) 459 @param char character to test (one character string)
460 @return flag indicating a mark character (boolean) 460 @return flag indicating a mark character (boolean)
461 """ 461 """
462 return unicodedata.category(str(char)) in ["Mn", "Mc", "Me"] 462 return unicodedata.category(str(char)) in ("Mn", "Mc", "Me")
463
464 def __isSymbol(self, char):
465 """
466 Private method to check, if a character is a symbol.
467
468 @param char character to test (one character string)
469 @return flag indicating a symbol (boolean)
470 """
471 return unicodedata.category(str(char)) in ["Sm", "Sc", "Sk", "So"]
472 463
473 def __isPunct(self, char): 464 def __isPunct(self, char):
474 """ 465 """
475 Private method to check, if a character is a punctuation character. 466 Private method to check, if a character is a punctuation character.
476 467
477 @param char character to test (one character string) 468 @param char character to test (one character string)
478 @return flag indicating a punctuation character (boolean) 469 @return flag indicating a punctuation character (boolean)
479 """ 470 """
480 return unicodedata.category(str(char)) in [ 471 return unicodedata.category(str(char)) in (
481 "Pc", 472 "Pc",
482 "Pd", 473 "Pd",
483 "Ps", 474 "Ps",
484 "Pe", 475 "Pe",
485 "Pi", 476 "Pi",
486 "Pf", 477 "Pf",
487 "Po", 478 "Po",
488 ] 479 )
480
481 def __isSymbol(self, char):
482 """
483 Private method to check, if a character is a symbol.
484
485 @param char character to test (one character string)
486 @return flag indicating a symbol (boolean)
487 """
488 return unicodedata.category(str(char)) in ("Sm", "Sc", "Sk", "So")
489 489
490 def getLocale(self): 490 def getLocale(self):
491 """ 491 """
492 Public method to get the used locale. 492 Public method to get the used locale.
493 493

eric ide

mercurial