mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
python-3.6.zip added from Github
README.cosmo contains the necessary links.
This commit is contained in:
parent
75fc601ff5
commit
0c4c56ff39
4219 changed files with 1968626 additions and 0 deletions
42
third_party/python/Lib/idlelib/zzdummy.py
vendored
Normal file
42
third_party/python/Lib/idlelib/zzdummy.py
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
"Example extension, also used for testing."
|
||||
|
||||
from idlelib.config import idleConf
|
||||
|
||||
ztext = idleConf.GetOption('extensions', 'ZzDummy', 'z-text')
|
||||
|
||||
|
||||
class ZzDummy:
|
||||
|
||||
## menudefs = [
|
||||
## ('format', [
|
||||
## ('Z in', '<<z-in>>'),
|
||||
## ('Z out', '<<z-out>>'),
|
||||
## ] )
|
||||
## ]
|
||||
|
||||
def __init__(self, editwin):
|
||||
self.text = editwin.text
|
||||
z_in = False
|
||||
|
||||
@classmethod
|
||||
def reload(cls):
|
||||
cls.ztext = idleConf.GetOption('extensions', 'ZzDummy', 'z-text')
|
||||
|
||||
def z_in_event(self, event):
|
||||
"""
|
||||
"""
|
||||
text = self.text
|
||||
text.undo_block_start()
|
||||
for line in range(1, text.index('end')):
|
||||
text.insert('%d.0', ztest)
|
||||
text.undo_block_stop()
|
||||
return "break"
|
||||
|
||||
def z_out_event(self, event): pass
|
||||
|
||||
ZzDummy.reload()
|
||||
|
||||
##if __name__ == "__main__":
|
||||
## import unittest
|
||||
## unittest.main('idlelib.idle_test.test_zzdummy',
|
||||
## verbosity=2, exit=False)
|
Loading…
Add table
Add a link
Reference in a new issue