Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/idlelib/zzdummy.py @ 69:33d812a61356
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 17:55:14 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 69:33d812a61356 |
---|---|
1 "Example extension, also used for testing." | |
2 | |
3 from idlelib.config import idleConf | |
4 | |
5 ztext = idleConf.GetOption('extensions', 'ZzDummy', 'z-text') | |
6 | |
7 | |
8 class ZzDummy: | |
9 | |
10 ## menudefs = [ | |
11 ## ('format', [ | |
12 ## ('Z in', '<<z-in>>'), | |
13 ## ('Z out', '<<z-out>>'), | |
14 ## ] ) | |
15 ## ] | |
16 | |
17 def __init__(self, editwin): | |
18 self.text = editwin.text | |
19 z_in = False | |
20 | |
21 @classmethod | |
22 def reload(cls): | |
23 cls.ztext = idleConf.GetOption('extensions', 'ZzDummy', 'z-text') | |
24 | |
25 def z_in_event(self, event): | |
26 """ | |
27 """ | |
28 text = self.text | |
29 text.undo_block_start() | |
30 for line in range(1, text.index('end')): | |
31 text.insert('%d.0', ztest) | |
32 text.undo_block_stop() | |
33 return "break" | |
34 | |
35 def z_out_event(self, event): pass | |
36 | |
37 ZzDummy.reload() | |
38 | |
39 ##if __name__ == "__main__": | |
40 ## import unittest | |
41 ## unittest.main('idlelib.idle_test.test_zzdummy', | |
42 ## verbosity=2, exit=False) |