613 Private slot called when the Python version was selected. |
613 Private slot called when the Python version was selected. |
614 |
614 |
615 @param checked state of the Python 2 button (boolean) |
615 @param checked state of the Python 2 button (boolean) |
616 """ |
616 """ |
617 # set the checkboxes |
617 # set the checkboxes |
618 self.localeCheckBox.setHidden(not checked) |
618 self.localeCheckBox.setEnabled(checked) |
619 if checked: |
619 if checked: |
620 self.unicodeCheckBox.setText(self.trUtf8("Unicode")) |
620 self.unicodeCheckBox.setText(self.trUtf8("Unicode")) |
621 else: |
621 else: |
622 self.unicodeCheckBox.setText(self.trUtf8("ASCII")) |
622 self.unicodeCheckBox.setText(self.trUtf8("ASCII")) |
623 self.unicodeCheckBox.setChecked(not self.unicodeCheckBox.isChecked()) |
623 self.unicodeCheckBox.setChecked(not self.unicodeCheckBox.isChecked()) |
672 flags = " | ".join(flags) |
672 flags = " | ".join(flags) |
673 |
673 |
674 code = '' |
674 code = '' |
675 if self.importCheckBox.isChecked(): |
675 if self.importCheckBox.isChecked(): |
676 code += 'import re{0}{1}'.format(os.linesep, istring) |
676 code += 'import re{0}{1}'.format(os.linesep, istring) |
677 code += '{0} = re.compile(r"""{1}"""'.format( |
677 code += '{0} = re.compile('.format(reVar) |
678 reVar, regexp.replace('"', '\\"')) |
678 code += '{0}{1}r"""{2}"""'.format( |
|
679 os.linesep, i1string, regexp.replace('"', '\\"')) |
679 if flags: |
680 if flags: |
680 code += ', {0}{1}{2}'.format(os.linesep, i1string, flags) |
681 code += ',{0}{1}{2}'.format(os.linesep, i1string, flags) |
681 code += '){0}'.format(estring) |
682 code += '){0}'.format(estring) |
682 return code |
683 return code |
683 |
684 |
684 |
685 |
685 class PyRegExpWizardDialog(QDialog): |
686 class PyRegExpWizardDialog(QDialog): |