| 1753 | |
| 1754 | |
| 1755 | class ShedPage(Frame): |
| 1756 | |
| 1757 | def __init__(self, master): |
| 1758 | super().__init__(master) |
| 1759 | |
| 1760 | self.init_validators() |
| 1761 | self.create_page_shed() |
| 1762 | self.load_shelled_cfg() |
| 1763 | |
| 1764 | def init_validators(self): |
| 1765 | digits_or_empty_re = re.compile(r'[0-9]*') |
| 1766 | def is_digits_or_empty(s): |
| 1767 | "Return 's is blank or contains only digits'" |
| 1768 | return digits_or_empty_re.fullmatch(s) is not None |
| 1769 | self.digits_only = (self.register(is_digits_or_empty), '%P',) |
| 1770 | |
| 1771 | def create_page_shed(self): |
| 1772 | """Return frame of widgets for Shell/Ed tab. |
| 1773 | |
| 1774 | Enable users to provisionally change shell and editor options. |
| 1775 | Function load_shed_cfg initializes tk variables using idleConf. |
| 1776 | Entry box auto_squeeze_min_lines_int sets |
| 1777 | auto_squeeze_min_lines_int. Setting var_name invokes the |
| 1778 | default callback that adds option to changes. |
| 1779 | |
| 1780 | Widgets for ShedPage(Frame): (*) widgets bound to self |
| 1781 | frame_shell: LabelFrame |
| 1782 | frame_auto_squeeze_min_lines: Frame |
| 1783 | auto_squeeze_min_lines_title: Label |
| 1784 | (*)auto_squeeze_min_lines_int: Entry - |
| 1785 | auto_squeeze_min_lines |
| 1786 | frame_editor: LabelFrame |
| 1787 | frame_save: Frame |
| 1788 | run_save_title: Label |
| 1789 | (*)save_ask_on: Radiobutton - autosave |
| 1790 | (*)save_auto_on: Radiobutton - autosave |
| 1791 | frame_format: Frame |
| 1792 | format_width_title: Label |
| 1793 | (*)format_width_int: Entry - format_width |
| 1794 | frame_line_numbers_default: Frame |
| 1795 | line_numbers_default_title: Label |
| 1796 | (*)line_numbers_default_bool: Checkbutton - line_numbers_default |
| 1797 | frame_context: Frame |
| 1798 | context_title: Label |
| 1799 | (*)context_int: Entry - context_lines |
| 1800 | """ |
| 1801 | # Integer values need StringVar because int('') raises. |
| 1802 | self.auto_squeeze_min_lines = tracers.add( |
| 1803 | StringVar(self), ('main', 'PyShell', 'auto-squeeze-min-lines')) |
| 1804 | |
| 1805 | self.autosave = tracers.add( |
| 1806 | IntVar(self), ('main', 'General', 'autosave')) |
| 1807 | self.line_numbers_default = tracers.add( |
| 1808 | BooleanVar(self), |
| 1809 | ('main', 'EditorWindow', 'line-numbers-default')) |
| 1810 | self.context_lines = tracers.add( |
| 1811 | StringVar(self), ('extensions', 'CodeContext', 'maxlines')) |
| 1812 |
no outgoing calls
no test coverage detected
searching dependent graphs…