341 |
342 |
342 def __populateCharTypeCombo(self, combo, isSingle): |
343 def __populateCharTypeCombo(self, combo, isSingle): |
343 """ |
344 """ |
344 Private method to populate a given character type selection combo box. |
345 Private method to populate a given character type selection combo box. |
345 |
346 |
346 @param combo reference to the combo box to be populated (QComboBox) |
347 @param combo reference to the combo box to be populated |
347 @param isSingle flag indicating a singles combo (boolean) |
348 @type QComboBox |
|
349 @param isSingle flag indicating a singles combo |
|
350 @type bool |
348 """ |
351 """ |
349 for txt, value in self.comboItems: |
352 for txt, value in self.comboItems: |
350 combo.addItem(txt, value) |
353 combo.addItem(txt, value) |
351 if isSingle: |
354 if isSingle: |
352 for txt, value in self.singleComboItems: |
355 for txt, value in self.singleComboItems: |
431 |
434 |
432 def __populateCharacterCombo(self, combo, formatIdentifier): |
435 def __populateCharacterCombo(self, combo, formatIdentifier): |
433 """ |
436 """ |
434 Private method to populate a character selection combo. |
437 Private method to populate a character selection combo. |
435 |
438 |
436 @param combo combo box to be populated (QComboBox) |
439 @param combo combo box to be populated |
|
440 @type QComboBox |
437 @param formatIdentifier format identifier (one of "-ccp", "-ccn", |
441 @param formatIdentifier format identifier (one of "-ccp", "-ccn", |
438 "-cbp", "-cbn", "-csp", "-csn", "-psp", "-psn") |
442 "-cbp", "-cbn", "-csp", "-csn", "-psp", "-psn") |
|
443 @type str |
439 """ |
444 """ |
440 combo.clear() |
445 combo.clear() |
441 |
446 |
442 if formatIdentifier in ["-ccp", "-ccn"]: |
447 if formatIdentifier in ["-ccp", "-ccn"]: |
443 items = self.__characterCategories |
448 items = self.__characterCategories |
456 |
461 |
457 def __performSelectedAction(self, formatIdentifier, lineedit, combo): |
462 def __performSelectedAction(self, formatIdentifier, lineedit, combo): |
458 """ |
463 """ |
459 Private method performing some actions depending on the input. |
464 Private method performing some actions depending on the input. |
460 |
465 |
461 @param formatIdentifier format of the selected entry (string) |
466 @param formatIdentifier format of the selected entry |
462 @param lineedit line edit widget to act on (QLineEdit) |
467 @type str |
463 @param combo combo box widget to act on (QComboBox) |
468 @param lineedit line edit widget to act on |
|
469 @type QLineEdit |
|
470 @param combo combo box widget to act on |
|
471 @type QComboBox |
464 """ |
472 """ |
465 if formatIdentifier == "-i": |
473 if formatIdentifier == "-i": |
466 return |
474 return |
467 |
475 |
468 if formatIdentifier in ["-c", "-h", "-o"]: |
476 if formatIdentifier in ["-c", "-h", "-o"]: |
535 |
543 |
536 def __formatCharacter(self, char, formatIdentifier): |
544 def __formatCharacter(self, char, formatIdentifier): |
537 """ |
545 """ |
538 Private method to format the characters entered into the dialog. |
546 Private method to format the characters entered into the dialog. |
539 |
547 |
540 @param char character string entered into the dialog (string) |
548 @param char character string entered into the dialog |
|
549 @type str |
541 @param formatIdentifier string giving a special format (-c, -h, -i or |
550 @param formatIdentifier string giving a special format (-c, -h, -i or |
542 -o) or the already formatted character (string) |
551 -o) or the already formatted character |
543 @return formatted character string (string) |
552 @type str |
|
553 @return formatted character string |
|
554 @rtype str |
544 """ |
555 """ |
545 if formatIdentifier == "-c": |
556 if formatIdentifier == "-c": |
546 return char |
557 return char |
547 elif formatIdentifier == "-i": |
558 elif formatIdentifier == "-i": |
548 return "" |
559 return "" |
573 |
584 |
574 def getCharacters(self): |
585 def getCharacters(self): |
575 """ |
586 """ |
576 Public method to return the character string assembled via the dialog. |
587 Public method to return the character string assembled via the dialog. |
577 |
588 |
578 @return formatted string for character classes (string) |
589 @return formatted string for character classes |
|
590 @rtype str |
579 """ |
591 """ |
580 regexp = "" |
592 regexp = "" |
581 |
593 |
582 # negative character range |
594 # negative character range |
583 if self.negativeCheckBox.isChecked(): |
595 if self.negativeCheckBox.isChecked(): |