Skip to content

Instantly share code, notes, and snippets.

@JoshAshby
Created June 15, 2009 23:14
Show Gist options
  • Save JoshAshby/130418 to your computer and use it in GitHub Desktop.
Save JoshAshby/130418 to your computer and use it in GitHub Desktop.
PyTe is a source code editor that i wrote over my summer break because i couldn't find any editors that i liked, hope he works well, does for me you will need python2.5/2.6 pyqt and possibly QT to run PyTe properly. Joshua Ashby http://joshashby.com 2009
import sys
import os
__Dir = os.path.dirname(sys.argv[0])
_pkg_config = {
'Dir' : __Dir,
'Pix' : os.path.join(__Dir, 'pix'),
'Icon' : os.path.join(__Dir, 'icon'),
'Doc' : os.path.join(__Dir, 'doc'),
'Examples' : os.path.join(__Dir, 'examples'),
'Others' : __Dir,
'bindir' : __Dir,
'mdir' : __Dir,
'qtui' : True,
'qttable' : True,
'qtcanvas' : True,
}
def getConfig(name):
try:
return _pkg_config[name]
except KeyError:
pass
raise AttributeError, '"%s" is not a valid configuration value' % name
#!/usr/bin/env python
#!/usr/local/bin/python
#====================About===========================
#PyTe
#PyTe is a source code editor that i wrote over my summer break because
#i couldn't find any editors that i liked, hope he works well, does for me
#you will need python2.5/2.6 pyqt and possibly QT to run PyTe properly
#Joshua Ashby
#http://joshashby.com
#2009
#I hold no responsibility for anything that may happen to your
#computer if you use this program or any program written in it.
#By Using PyTe you agree to the terms of use, gpl, gnu license, and
#the Python, and Qt License's
#All Trademarks Subject to their owners
#===================================================
#Ver2.2.4b
#===================================================
#5-12-09
#added the option to load a file from the command line
import sys, string
from qt import *
from qtext import *
import os
from splashscreen import *
from config import getConfig
image0_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \
"\x74\x49\x44\x41\x54\x38\x8d\xed\xd5\xc1\x09\xc0" \
"\x20\x0c\x05\xd0\x6f\xe9\x36\x81\x2c\x10\xb2\xff" \
"\xdd\x85\xd2\x53\x85\xb6\xa9\x91\x48\x0f\x05\x3f" \
"\x08\x1a\xf0\x29\x12\x10\xf8\x28\xc5\xa9\xd9\xc4" \
"\xde\x96\xcd\x2b\x9a\xd9\xeb\x00\x00\x66\x0e\x2f" \
"\xe0\xc2\x51\x98\x39\xc4\xf7\x0c\x4c\x44\x6d\x5e" \
"\x6b\x35\x38\xcf\x92\x82\x45\xe4\xb2\xf6\xf0\x14" \
"\xac\xaa\x8f\xda\x1d\x4f\xc1\xa5\x74\x1b\x22\x07" \
"\x9f\x9d\x11\x1d\x96\xea\x8a\x91\x2c\x78\xc1\x0b" \
"\xee\x64\xe6\x07\x19\xf5\x7e\x92\x03\xad\x45\x2a" \
"\x04\xcc\x4e\x50\x20\x00\x00\x00\x00\x49\x45\x4e" \
"\x44\xae\x42\x60\x82"
image1_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \
"\x99\x49\x44\x41\x54\x38\x8d\xed\x94\x41\x0e\x85" \
"\x20\x0c\x44\x5f\x89\xc7\x36\x7f\x61\xbc\x77\x5d" \
"\x28\x48\xa4\x28\x60\xff\xce\xd9\x54\x8b\xbe\x8e" \
"\x13\x04\x3e\x1d\x92\x81\x77\xf4\x81\xa1\x23\xdc" \
"\x2b\x34\xf6\xf4\x7a\x3d\xe2\xb8\x65\xa8\x84\x3f" \
"\x40\x01\x98\x2a\x0b\x3d\x5f\x62\xc5\x83\x00\xaa" \
"\x1a\xd7\x05\x50\x44\x9a\xb9\xd5\x07\xa7\x73\xa8" \
"\xa4\xba\x4f\x92\xa2\xdf\x33\x3c\x64\xc6\x3b\xeb" \
"\xbd\x82\xe5\xb8\xad\xde\xcb\xcc\x78\x20\xeb\x42" \
"\x66\xc6\x39\x74\x5d\xfa\x80\xf3\x6f\xaf\x66\xc6" \
"\x6f\xa1\x9c\x3f\x88\x2f\xb4\x70\xec\x05\xcd\xc0" \
"\xbe\xd0\x78\x93\xf6\x8e\x17\x14\x92\x63\x5f\x68" \
"\x6c\x3e\xef\xf6\xba\x3c\x8f\xdd\x36\x6d\xc4\xc0" \
"\x45\x2c\x87\x81\xf8\x08\x00\x00\x00\x00\x49\x45" \
"\x4e\x44\xae\x42\x60\x82"
image2_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \
"\xa0\x49\x44\x41\x54\x38\x8d\xd5\x95\x4d\x0a\x80" \
"\x20\x10\x85\x9f\xd1\x46\x68\xe1\x8d\xe6\x62\xd2" \
"\x22\xbc\x98\x37\x6a\x21\xb4\xac\x45\x19\x92\xc6" \
"\x64\x69\xe0\xb7\xf1\x87\xf1\xf1\x1c\x47\x05\x2a" \
"\x21\x8e\x76\x2d\xad\xdb\xfb\x9e\x99\xf6\x56\x8f" \
"\x80\xb5\x36\x4b\x85\x88\xce\x35\x44\x04\x00\xe8" \
"\x0a\x39\x8c\xe8\xf9\x90\x34\xd2\x29\x2c\xc3\x7c" \
"\x8e\xbd\x53\x0f\xeb\x58\x3a\x05\xe9\x54\x34\x1f" \
"\x8a\x02\x7b\x2a\x7d\x3a\x1f\x09\xbf\x85\x4d\xc5" \
"\xd5\xd9\x53\xaa\x39\x6e\x4f\x38\xca\xb1\x99\xe2" \
"\xd2\xe1\x08\xab\xe1\x56\xf8\x2e\x30\x97\x7f\xcb" \
"\x4d\x8f\xf9\x42\xd7\x5d\xbe\xbe\xd2\xe1\x43\x95" \
"\x3a\x93\xf6\xca\xad\x3d\x61\x11\xf4\x4b\x7d\x4f" \
"\x82\x0f\xf9\xc0\x06\x9b\xb5\x1e\xcd\xed\x31\x8c" \
"\x5c\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60" \
"\x82"
image3_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x02" \
"\x9c\x49\x44\x41\x54\x38\x8d\x8d\x95\xad\x76\xdb" \
"\x40\x10\x85\x3f\xf7\x18\xcc\x32\x89\xd9\x50\xd0" \
"\x61\x36\x34\x4c\x98\xc3\x62\x96\x40\x87\x25\x6f" \
"\x50\x3f\x42\x61\x61\x02\x1b\xe6\xb2\x84\x25\x50" \
"\x61\x2e\x8b\xe1\x42\x99\x49\x6c\x86\x6d\xc1\x4a" \
"\xb2\xfc\x77\xda\x21\x92\x66\x57\x77\xee\xdc\x3b" \
"\x5a\xf5\x38\x13\xaf\xaf\xaf\x41\x44\x48\xd3\x74" \
"\x2f\x6f\x66\x00\xa8\x2a\x00\x55\x55\x91\x24\x09" \
"\x57\x57\x57\xbd\xee\xbe\xfe\x39\x60\x11\x61\x32" \
"\x99\xb4\x40\x87\x6b\x4d\x94\x65\x89\xf7\xfe\x68" \
"\xcf\x59\x60\x80\xcd\x66\x73\x04\x76\x58\x48\x55" \
"\x71\xce\xfd\x3f\xf0\x29\x00\x33\x3b\x2a\x70\xaa" \
"\x23\x80\x6f\xa7\x92\x79\x9e\x07\x33\x6b\x99\x38" \
"\xe7\x70\xce\xed\xe9\xdd\xe8\x2f\x22\x47\xfa\x9e" \
"\x65\xac\xaa\x24\x49\x42\x59\x96\x88\x48\x6b\x54" \
"\x37\x4e\xb5\xff\x4f\xc6\x10\x5b\x3c\x9c\x88\x2e" \
"\x68\x53\xec\x9c\x14\x27\x19\x37\x6c\x4e\x31\xed" \
"\xe6\x55\x75\x6f\x42\xba\x71\xa4\x0d\xc0\x6a\xb5" \
"\x0a\x59\x96\x31\x1c\x0e\xcf\x82\x37\x46\x7e\x7e" \
"\x7e\x02\x20\x92\x30\x9f\x5f\xb7\x78\x7b\x8c\xdf" \
"\xdf\xdf\x83\xf7\x9e\xfc\x23\x47\x66\x82\x88\xb4" \
"\x00\x87\xd7\x86\x69\x59\x94\xe4\x79\xce\xb6\xda" \
"\xf2\xf0\xf0\x10\x66\xb3\x19\xd7\xd7\xd7\xbd\x5e" \
"\x17\x74\xb3\xf1\x54\xc5\x16\x35\x80\xd3\x4c\x01" \
"\x9c\xa4\x08\x02\x0e\x7c\xe1\x59\xaf\xff\xb0\xdd" \
"\x16\xa8\x1a\x17\x17\x19\x8b\xc5\x22\x4a\xd1\x30" \
"\xbd\x9c\x5e\xe2\xd2\x14\x55\x03\x53\x8e\x6c\x31" \
"\x03\x84\x9c\x4f\x3e\x78\x65\x6a\x53\xd2\xaf\x94" \
"\xe7\x97\x67\xfc\x57\xfc\xfa\xd4\x94\x6c\x74\x11" \
"\x41\x9f\x9e\x7e\x85\xb2\x28\xc3\xff\xc4\x57\xf8" \
"\x0a\xa3\x30\x0a\x12\x24\x8c\xc2\x28\xac\xd7\xeb" \
"\xf0\xe3\xfb\xcf\x30\x1e\x8f\xc3\x60\x90\x85\x24" \
"\x49\x42\x36\xc8\x42\xbf\xda\x56\xdc\xdd\xdd\x9c" \
"\x75\xf7\x30\x52\x52\x2e\x99\x92\x23\xcc\x98\x31" \
"\x1e\x8f\x49\x64\x48\x69\x05\xcf\xbf\x5e\xa8\xaa" \
"\x8a\x74\x90\xd2\x37\xc0\xfb\x22\xce\xa3\x19\x88" \
"\x10\x6b\x48\xed\x36\x38\x5c\x54\xdc\x14\xc4\xf1" \
"\x60\xdf\xb9\xc1\x33\xb4\x21\x7f\xd8\x80\x19\xe9" \
"\x70\x18\xd7\x6b\x77\xfa\x65\x51\xe0\x45\xa2\x9e" \
"\x66\xb4\xbe\x39\x88\x2e\xd6\x9d\x38\x03\x15\x20" \
"\xe6\x04\xf0\xb6\xc5\x88\x67\x88\xdf\x6c\x5a\x4f" \
"\x1c\xf5\xb8\x35\x09\x6b\x00\xb1\x76\x28\x14\x8b" \
"\x35\x74\x6f\x67\x3b\x39\xd2\x78\xda\x09\x45\xe9" \
"\x23\x60\x65\xe7\x05\xad\xc9\x76\x37\x1a\x20\x0a" \
"\x76\xb8\xe2\x30\x2b\xa9\xfb\x6c\x7a\x63\x32\x99" \
"\xf2\x0d\xeb\xb0\x6c\xc9\x6a\x7c\xb4\xfa\xba\x07" \
"\xea\x9a\x6d\x35\x68\x0d\x58\xcb\x39\x18\x0c\x58" \
"\x2c\xee\x22\x63\xef\x7d\x63\x15\x88\x41\x25\x40" \
"\x15\x9d\x33\x8b\x30\xd2\xb0\xb2\x1d\x18\x3b\xcd" \
"\x31\x43\x04\x96\xcb\x25\xf3\xf9\xbc\xd7\xcf\xb2" \
"\x8c\x8f\xb7\x0f\x7e\xbf\xbd\xa1\x6a\xc4\xf3\x47" \
"\xd8\x1b\x3e\xe9\x3c\xcb\x0e\xb2\xed\xb3\x9e\xa6" \
"\xe5\x72\xc9\xe3\xe3\x63\x0f\x3a\x87\xd0\x6a\xb5" \
"\x0a\xab\xd5\x1b\xdb\xfa\xff\xa5\x68\x6d\xca\xce" \
"\x99\xdd\x5f\x03\x54\xcb\x78\x5f\x19\x93\xe9\x84" \
"\xdb\xdb\x5b\xee\xef\xef\x5b\xbc\xbf\xd1\xf6\x9e" \
"\x0c\x3f\xec\x24\x86\x00\x00\x00\x00\x49\x45\x4e" \
"\x44\xae\x42\x60\x82"
image4_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \
"\x73\x49\x44\x41\x54\x38\x8d\xed\x92\xc1\x0e\x80" \
"\x20\x08\x40\xb1\xef\x66\x1d\x1c\xff\x4d\x87\x6a" \
"\xa8\x88\xa1\x76\x69\xf9\x36\x0f\x28\x3e\xd8\x00" \
"\x60\xf1\x59\x42\x5f\x3a\x71\xf5\x36\x02\xe0\x8e" \
"\x99\x2b\x09\x88\x01\xd0\x28\x54\x17\x6a\xe4\x7f" \
"\x21\xce\x1f\xb5\xb0\x5d\x38\xed\xdc\x90\x60\xd0" \
"\xf1\x13\x79\x63\x5b\x3b\xc9\x2b\xd5\x18\xe2\x39" \
"\xa9\x43\xec\x1d\x5a\xb7\x78\x5c\xee\x10\x7b\xe4" \
"\xb2\x15\xaf\x40\x91\xf8\x94\xde\x47\x18\x1e\xce" \
"\xa5\x9e\xde\x9e\xc5\x9f\x38\x00\x62\xac\x28\xb1" \
"\xe3\xd7\x01\xd9\x00\x00\x00\x00\x49\x45\x4e\x44" \
"\xae\x42\x60\x82"
image5_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \
"\x74\x49\x44\x41\x54\x38\x8d\xed\x92\xc1\x0a\xc0" \
"\x20\x08\x40\x6d\xdf\x2d\x3b\x84\xff\xed\x0e\xa3" \
"\x58\x6a\x26\xd1\x65\xe0\x83\x0e\xa5\x3e\x85\x04" \
"\x48\x7e\x4b\x91\x0f\x54\x89\xf1\x9e\xa5\xa3\xca" \
"\x0f\x8a\x89\x63\x65\xb3\x06\xc4\x2d\xd6\x13\xc6" \
"\x49\xbd\xc2\x59\x83\x16\x13\x62\x19\xf0\xf9\x36" \
"\xc0\xa2\xef\x00\xd7\x5a\x62\x61\x4d\x3a\xb2\x29" \
"\x96\xf2\xa3\x62\xff\xa3\x37\xc5\xeb\xed\xe9\x62" \
"\xaa\xd1\xa2\xe8\x4a\xaa\xa2\xf7\x50\xdd\x12\x74" \
"\x8c\x0f\xd0\xab\x93\x24\x67\x78\x00\x59\x6e\x28" \
"\xb1\x74\x3f\x46\x86\x00\x00\x00\x00\x49\x45\x4e" \
"\x44\xae\x42\x60\x82"
image6_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \
"\x82\x49\x44\x41\x54\x38\x8d\xcd\xd3\x41\x12\x80" \
"\x20\x08\x05\x50\xe8\xe0\x2e\xbc\x38\xad\x32\x73" \
"\x50\x3e\x48\x53\x7f\xe3\xe4\x8c\x4f\x24\x25\xfa" \
"\x28\xe2\x9c\x6f\x39\x92\x0b\xf9\x27\x6c\xb6\x01" \
"\x85\x35\x88\x77\x61\x13\x88\xc2\x57\x64\x18\xcd" \
"\xa0\x15\xf5\x20\xb4\xe6\xb5\x5b\xe1\x09\xdc\x06" \
"\x22\xb8\xe2\x2a\xcf\x31\x05\x6e\x18\xdf\xdf\xf8" \
"\x06\x06\xaa\x55\x1c\xc6\x35\x64\xc4\xdc\xf8\x0c" \
"\xd0\x20\x1d\x57\x7a\x5c\x85\xa8\x84\x5f\xdc\x02" \
"\x5e\xa5\x30\x7a\xfc\xcd\x07\xe2\x3a\x1d\xf2\x83" \
"\xec\x2b\x37\xd9\xad\x5f\xb4\xdf\xef\xd4\x9c\xfb" \
"\xf7\x2f\xac\x98\xc8\xcc\x89\x00\x00\x00\x00\x49" \
"\x45\x4e\x44\xae\x42\x60\x82"
image7_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \
"\xbf\x49\x44\x41\x54\x38\x8d\xd5\x93\x41\x0a\x83" \
"\x30\x10\x45\xdf\x48\x8e\xe5\x1d\xbc\x8c\x3b\xa9" \
"\x8b\xf4\x6a\x9e\xab\xd3\x85\x35\x0d\x26\x63\x62" \
"\x44\x4a\x3f\x0c\x42\x66\xfc\xf3\xf8\x24\xf0\x6f" \
"\x12\x40\x2b\x66\xda\x8c\x55\xf3\xde\x22\x12\xcf" \
"\x9d\x92\xcb\x98\xc0\xba\x2d\x7c\x45\x44\xcf\x9a" \
"\x07\x63\x8b\xba\xd5\x3c\x44\x91\x23\x5e\xcf\x7c" \
"\xc1\x62\x36\x97\xa9\x25\x40\xc1\x1f\xf4\xfd\xa7" \
"\x52\x75\x01\x5d\x24\xa9\x38\x9e\x7d\x6f\x53\xdf" \
"\x4f\xe4\xcc\xab\x32\x3e\xea\x0f\x03\xc0\xc4\xb2" \
"\xa0\x71\x2c\xe6\xad\xd8\x9b\x59\xb7\x66\x1c\x3b" \
"\xe0\x95\x98\x5f\x26\x16\x79\xee\x4e\xbc\xc2\x2c" \
"\x97\x88\x55\x1f\xe6\xa2\xcb\xc4\x96\x9a\x89\x4b" \
"\xcb\x6f\x23\xee\x36\x1a\xab\x62\xe2\x52\xc5\x72" \
"\x94\xdf\xbf\xb6\x10\xbb\xf2\xc8\x97\xb8\xa4\x6c" \
"\xc6\x67\x7e\xaa\x51\x95\x71\xfa\x08\x7e\xa8\x37" \
"\x62\xda\x9a\xba\xcb\x20\x23\x5f\x00\x00\x00\x00" \
"\x49\x45\x4e\x44\xae\x42\x60\x82"
image8_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \
"\xd5\x49\x44\x41\x54\x38\x8d\xc5\x95\x5d\x0a\x84" \
"\x30\x0c\x84\x27\xe2\xa9\x0a\x9e\x6c\x8b\x0f\x4b" \
"\x3d\xd9\x82\xd7\xca\x3e\x58\xd7\xfe\x4c\xd0\xba" \
"\x5d\x76\x40\x02\x4d\xf2\x65\xda\x0a\x05\x7e\x24" \
"\x39\xc9\xeb\x8d\x9e\xaa\x88\x41\xa0\xc9\xaa\xd8" \
"\xc8\x2a\xb3\x2f\x9c\x42\x5b\xe1\xe3\x0e\x0d\xcf" \
"\x00\xc0\x03\x08\xf0\xb3\xa7\xa0\x74\x10\xa9\xd7" \
"\x14\x2e\x00\xb4\x2c\x5a\x5f\xab\x69\x6b\x97\x9b" \
"\x1c\x83\x7f\xc0\xc3\x16\xb6\xe4\x16\x5b\x64\xf7" \
"\x8d\x71\x63\x59\x91\x9b\xdc\x45\x70\xde\x47\xc0" \
"\x47\x32\xdd\x5e\x5b\xcc\x35\xf0\xc9\x77\x62\xae" \
"\x78\x79\x36\xdc\xcf\x75\x13\x57\x7e\x79\xf4\x8c" \
"\x4b\x27\xaa\x0f\x13\x27\xb2\x40\xf5\x11\x7f\xcb" \
"\xe3\x48\xaa\x33\xb6\xe0\x22\x4b\x05\x4d\x07\x46" \
"\xb8\x02\x5e\x2e\x3b\x3e\x73\xcd\xe0\xdd\x1c\x97" \
"\xf0\x2e\x8e\xd9\xd0\xaf\x1d\xb3\x81\x22\x4b\xdf" \
"\x33\xee\xe6\x98\xa9\x34\xa0\xf6\x17\xb4\x55\x40" \
"\xd0\x0b\xcf\x4c\xa0\x8f\xc0\xdf\xf4\x06\xe3\x25" \
"\xc1\x98\x1b\xc4\x18\x76\x00\x00\x00\x00\x49\x45" \
"\x4e\x44\xae\x42\x60\x82"
image9_data = \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
"\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \
"\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x02" \
"\x5d\x49\x44\x41\x54\x38\x8d\xd5\x93\xa1\x72\xdb" \
"\x40\x10\x86\x3f\x67\x0a\x56\xec\xc4\x22\x78\xd0" \
"\x65\x36\x93\xa0\xc2\x1c\x68\xd6\xc2\xe6\x0d\xf2" \
"\x1a\x81\x81\x11\x34\x94\x99\xc2\x54\xa8\x32\x9b" \
"\x55\xf0\xe0\x89\xdd\xb1\x5b\xa6\x02\xb7\x9d\x66" \
"\x92\xd6\x99\xb6\xd3\x99\xfe\xe8\x6e\x67\xe7\xdb" \
"\x7f\x77\xef\xe0\x7f\xd3\xe2\xc7\x4b\xd7\x75\xb3" \
"\x73\x0e\xef\x3d\x51\x15\x00\x23\x82\xb5\x16\x6b" \
"\x2d\x57\x57\x57\x8b\x17\x29\xbf\x02\xb7\x6d\x3b" \
"\x0f\x87\x03\xb9\x2d\x58\xae\xd7\x60\x04\x00\xef" \
"\x1c\xe3\xc7\x03\x06\xa8\xaa\x8a\xeb\xeb\xeb\x57" \
"\xc1\x17\xdf\xa0\x6d\xdb\x52\x5d\xd7\x54\xef\xb6" \
"\x00\xa8\x2a\x49\x13\x8a\x12\x35\x32\xec\x3a\xc4" \
"\x2b\x9b\xcd\xe6\x55\xce\x2f\xfa\xbe\x9f\x87\xc3" \
"\x40\xfd\xe1\x3d\xcb\x4d\x8d\xaa\xa2\x4e\x48\xee" \
"\x12\xc6\x82\x38\x08\xc1\x07\x96\x9b\x1a\x8a\x9c" \
"\xe3\xf1\xf8\xaa\x51\x5c\x38\xe7\xc8\xad\xa5\xaa" \
"\x6b\x00\xc4\x5f\x12\x9c\x67\xd2\x23\x93\x8c\x88" \
"\xe6\xc8\x60\xd1\x18\xb1\xd5\x92\xd1\x39\xba\xae" \
"\x9b\xcf\x83\xa7\x89\x65\xb5\x46\x51\x34\x80\x1b" \
"\x1d\x2e\x1f\x49\x45\xc0\xe3\x50\x09\x64\x08\xea" \
"\x15\x44\x90\xc2\xe0\xbd\x3f\xef\x58\x53\xc2\xe4" \
"\x86\xa0\x01\x9f\x4d\x84\xf5\x84\x18\x41\x83\x62" \
"\xb0\x40\x8e\x8b\x23\xc9\x24\x50\x10\x93\x31\x4d" \
"\xd3\x59\xf0\x1b\x80\x98\x14\x11\x20\x25\x14\x40" \
"\x15\xf1\x96\x4c\x0b\xbc\x1b\x48\x4b\x07\xe4\x68" \
"\x88\x80\xc0\x29\xeb\xd7\x8e\x41\x41\xf5\xb4\x34" \
"\xfd\x76\x86\x4c\x05\x3f\x1e\x08\x4b\x0f\x85\x80" \
"\x26\x54\x40\x63\x40\x44\xce\x83\x8b\xbc\xc0\x39" \
"\x87\xa6\x13\x50\xa3\xa2\x28\x5e\x1d\x5a\x44\x14" \
"\xd0\x70\x8a\xa5\x98\x08\x21\x62\xad\x3d\x0f\xb6" \
"\xd6\xe2\x87\xcf\xa4\x98\x50\x8d\x27\x40\x50\x44" \
"\x73\x70\x42\x8c\x91\xaf\x8d\x10\xfd\x44\x81\x60" \
"\x8c\x39\x0b\x5e\x00\xdc\xdd\xdd\xcd\x8e\x80\xa9" \
"\xde\x42\x02\x48\xe8\x04\x84\x08\x56\xf0\x3e\x02" \
"\x90\x7d\x72\x94\x65\xc9\xba\x5a\xe3\x46\x87\x31" \
"\xe6\xa7\x9f\xe5\x02\x60\xb5\x5a\x61\x02\xc4\xee" \
"\x40\xa6\x89\x4c\x33\xf2\xcb\x0c\xb1\x06\x51\x28" \
"\x14\xf8\xf8\x99\xb2\x2c\xb9\xb9\xb9\x59\xb8\xd1" \
"\xf1\xf8\xf8\x48\xd3\x34\xb4\x6d\xfb\xe2\x9b\xfe" \
"\x5e\xad\xef\xfb\xf9\x78\x3c\x32\x3a\x87\x18\x81" \
"\xec\xb4\x20\x0d\x11\x51\xa8\xeb\x9a\xed\x76\xbb" \
"\x00\x18\x86\x61\xee\xba\x8e\xfd\x7e\x8f\x31\x86" \
"\xed\x76\xcb\x6a\xb5\x7a\xe2\xfe\x59\x1b\x5d\xd7" \
"\xcd\xde\x7b\x62\x8c\x88\x08\x79\x9e\x63\xad\xa5" \
"\xaa\xaa\x67\xb9\xbb\xdd\x6e\x6e\x9a\x06\xef\x3d" \
"\x75\x5d\x3f\x29\xfe\xc7\xea\xfb\x7e\xbe\xbd\xbd" \
"\x9d\xad\xb5\x73\x59\x96\xf3\xfd\xfd\xfd\xfc\xa2" \
"\xe3\xdf\xd5\xc3\xc3\xc3\xdc\x34\x0d\xd3\x34\xb1" \
"\xd9\x6c\xfe\x1e\x18\x4e\x63\xdc\xef\xf7\xa4\x94" \
"\xfe\x26\xf6\x1f\xe9\x0b\xbc\x4c\x5e\x59\xd6\x14" \
"\xca\xf4\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42" \
"\x60\x82"
editorList = []
class QSci(QextScintilla):
def __init__(self,parent):
QextScintilla.__init__(self,parent)
self.setUtf8(1)
lex = QextScintillaLexerPython(self)
self.setLexer(lex)
self.setBraceMatching(QextScintilla.SloppyBraceMatch)
self.setAutoIndent(1)
self.setIndentationWidth(4)
self.setIndentationGuides(1)
self.setIndentationsUseTabs(0)
self.setAutoCompletionThreshold(2)
class Form2(QMainWindow):
def __init__(self,parent = None,name = None,fl = 0):
QMainWindow.__init__(self,parent,name,fl)
self.statusBar()
self.image0 = QPixmap()
self.image0.loadFromData(image0_data,"PNG")
self.image1 = QPixmap()
self.image1.loadFromData(image1_data,"PNG")
self.image2 = QPixmap()
self.image2.loadFromData(image2_data,"PNG")
self.image3 = QPixmap()
self.image3.loadFromData(image3_data,"PNG")
self.image4 = QPixmap()
self.image4.loadFromData(image4_data,"PNG")
self.image5 = QPixmap()
self.image5.loadFromData(image5_data,"PNG")
self.image6 = QPixmap()
self.image6.loadFromData(image6_data,"PNG")
self.image7 = QPixmap()
self.image7.loadFromData(image7_data,"PNG")
self.image8 = QPixmap()
self.image8.loadFromData(image8_data,"PNG")
self.image9 = QPixmap()
self.image9.loadFromData(image9_data,"PNG")
if not name:
self.setName("Form2")
self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding,0,0,self.sizePolicy().hasHeightForWidth()))
self.fileNewAction = QAction(self,"fileNewAction")
self.fileNewAction.setIconSet(QIconSet(self.image0))
self.fileOpenAction = QAction(self,"fileOpenAction")
self.fileOpenAction.setIconSet(QIconSet(self.image1))
self.fileSaveAction = QAction(self,"fileSaveAction")
self.fileSaveAction.setIconSet(QIconSet(self.image2))
self.fileSaveAsAction = QAction(self,"fileSaveAsAction")
self.filePrintAction = QAction(self,"filePrintAction")
self.filePrintAction.setIconSet(QIconSet(self.image3))
self.fileExitAction = QAction(self,"fileExitAction")
self.editUndoAction = QAction(self,"editUndoAction")
self.editUndoAction.setIconSet(QIconSet(self.image4))
self.editRedoAction = QAction(self,"editRedoAction")
self.editRedoAction.setIconSet(QIconSet(self.image5))
self.editCutAction = QAction(self,"editCutAction")
self.editCutAction.setIconSet(QIconSet(self.image6))
self.editCopyAction = QAction(self,"editCopyAction")
self.editCopyAction.setIconSet(QIconSet(self.image7))
self.editPasteAction = QAction(self,"editPasteAction")
self.editPasteAction.setIconSet(QIconSet(self.image8))
self.editFindAction = QAction(self,"editFindAction")
self.editFindAction.setIconSet(QIconSet(self.image9))
self.helpContentsAction = QAction(self,"helpContentsAction")
self.helpIndexAction = QAction(self,"helpIndexAction")
self.helpAboutAction = QAction(self,"helpAboutAction")
self.lexerBashAction = QAction(self,"lexerBashAction")
self.lexerCAction = QAction(self,"lexerCAction")
self.lexerCSSAction = QAction(self,"lexerCSSAction")
self.lexerHTMLAction = QAction(self,"lexerHTMLAction")
self.lexerPerlAction = QAction(self,"lexerPerlAction")
self.lexerPythonAction = QAction(self,"lexerPythonAction")
self.lexerRubyAction = QAction(self,"lexerRubyAction")
self.lexerTexAction = QAction(self,"lexerTextAction")
self.toolBar = QToolBar(QString(""),self,Qt.DockTop)
self.fileNewAction.addTo(self.toolBar)
self.fileOpenAction.addTo(self.toolBar)
self.fileSaveAction.addTo(self.toolBar)
self.toolBar.addSeparator()
self.editUndoAction.addTo(self.toolBar)
self.editRedoAction.addTo(self.toolBar)
self.editCutAction.addTo(self.toolBar)
self.editCopyAction.addTo(self.toolBar)
self.editPasteAction.addTo(self.toolBar)
self.toolBar.addSeparator()
self.pushButton2 = QPushButton(self.toolBar,"pushButton2")
self.ToolBar = QToolBar(QString(""),self,Qt.DockTop)
self.pushButton14=QPushButton(self.ToolBar,"pushbutton14")
self.pushButton15=QPushButton(self.ToolBar,"pushbutton15")
self.pushButton16=QPushButton(self.ToolBar,"pushbutton16")
self.pushButton17=QPushButton(self.ToolBar,"pushButton17")
self.Toolbar = QToolBar(QString(""),self,Qt.DockTop)
self.pushButton9 = QPushButton(self.Toolbar,"pushButton9")
self.pushButton4 = QPushButton(self.Toolbar,"pushButton4")
self.pushButton10 = QPushButton(self.Toolbar,"pushButton10")
self.pushButton8 = QPushButton(self.Toolbar,"pushButton8")
self.pushButton6 = QPushButton(self.Toolbar,"pushButton6")
self.pushButton11 = QPushButton(self.Toolbar,"pushButton11")
self.pushButton5 = QPushButton(self.Toolbar,"pushButton5")
self.pushButton12 = QPushButton(self.Toolbar,"pushButton12")
self.pushButton13 = QPushButton(self.Toolbar,"pushButton13")
self.MenuBar = QMenuBar(self,"MenuBar")
self.fileMenu = QPopupMenu(self)
self.fileNewAction.addTo(self.fileMenu)
self.fileOpenAction.addTo(self.fileMenu)
self.fileSaveAction.addTo(self.fileMenu)
self.fileMenu.insertSeparator()
self.filePrintAction.addTo(self.fileMenu)
self.fileMenu.insertSeparator()
self.fileExitAction.addTo(self.fileMenu)
self.MenuBar.insertItem(QString(""),self.fileMenu,1)
self.editMenu = QPopupMenu(self)
self.editUndoAction.addTo(self.editMenu)
self.editRedoAction.addTo(self.editMenu)
self.editMenu.insertSeparator()
self.editCutAction.addTo(self.editMenu)
self.editCopyAction.addTo(self.editMenu)
self.editPasteAction.addTo(self.editMenu)
self.editMenu.insertSeparator()
self.editFindAction.addTo(self.editMenu)
self.MenuBar.insertItem(QString(""),self.editMenu,2)
self.helpMenu = QPopupMenu(self)
self.helpIndexAction.addTo(self.helpMenu)
self.helpMenu.insertSeparator()
self.helpAboutAction.addTo(self.helpMenu)
self.MenuBar.insertItem(QString(""),self.helpMenu,3)
self.Lexer = QPopupMenu(self)
self.lexerBashAction.addTo(self.Lexer)
self.lexerCAction.addTo(self.Lexer)
self.lexerCSSAction.addTo(self.Lexer)
self.lexerHTMLAction.addTo(self.Lexer)
self.lexerPerlAction.addTo(self.Lexer)
self.lexerPythonAction.addTo(self.Lexer)
self.lexerRubyAction.addTo(self.Lexer)
self.lexerTexAction.addTo(self.Lexer)
self.MenuBar.insertItem(QString(""),self.Lexer,4)
self.splitter = QSplitter(self)
self.e = QSci(self.splitter)
self.e.setFocus()
self.setCentralWidget(self.splitter)
self.languageChange()
self.resize(QSize(610,569).expandedTo(self.minimumSizeHint()))
self.clearWState(Qt.WState_Polished)
self.connect(self.fileNewAction,SIGNAL("activated()"),self.new1)
self.connect(self.fileOpenAction,SIGNAL("activated()"),self.open1)
self.connect(self.fileSaveAction,SIGNAL("activated()"),self.save1)
self.connect(self.fileSaveAsAction,SIGNAL("activated()"),self.saveas)
self.connect(self.helpIndexAction,SIGNAL("activated()"),self.about)
self.connect(self.helpAboutAction,SIGNAL("activated()"),self.aboutQt)
self.connect(self.fileExitAction,SIGNAL("activated()"),self.close)
self.connect(self.pushButton9,SIGNAL("clicked()"),self.bash)
self.connect(self.pushButton4,SIGNAL("clicked()"),self.cpp)
self.connect(self.pushButton10,SIGNAL("clicked()"),self.css)
self.connect(self.pushButton8,SIGNAL("clicked()"),self.html)
self.connect(self.pushButton6,SIGNAL("clicked()"),self.perl)
self.connect(self.pushButton11,SIGNAL("clicked()"),self.python)
self.connect(self.pushButton5,SIGNAL("clicked()"),self.ruby)
self.connect(self.pushButton12,SIGNAL("clicked()"),self.tex)
self.connect(self.pushButton13,SIGNAL("clicked()"),self.split)
self.connect(self.pushButton2,SIGNAL("clicked()"),self.run)
self.connect(self.lexerBashAction,SIGNAL("activated()"),self.bash)
self.connect(self.lexerCAction,SIGNAL("activated()"),self.cpp)
self.connect(self.lexerCSSAction,SIGNAL("activated()"),self.css)
self.connect(self.lexerHTMLAction,SIGNAL("activated()"),self.html)
self.connect(self.lexerPerlAction,SIGNAL("activated()"),self.perl)
self.connect(self.lexerPythonAction,SIGNAL("activated()"),self.python)
self.connect(self.lexerRubyAction,SIGNAL("activated()"),self.ruby)
self.connect(self.lexerTexAction,SIGNAL("activated()"),self.tex)
self.connect(self.pushButton14,SIGNAL("clicked()"),self.qt3)
self.connect(self.pushButton15,SIGNAL("clicked()"),self.qt4)
self.connect(self.pushButton16,SIGNAL("clicked()"),self.Atmega168)
self.connect(self.pushButton17,SIGNAL("clicked()"),self.Atmega328)
self.connect(self.editUndoAction,SIGNAL("activated()"),self.e.undo)
self.connect(self.editRedoAction,SIGNAL("activated()"),self.e.redo)
self.connect(self.editCutAction,SIGNAL("activated()"),self.e.cut)
self.connect(self.editCopyAction,SIGNAL("activated()"),self.e.copy)
self.connect(self.editPasteAction,SIGNAL("activated()"),self.e.paste)
if (len(sys.argv) > 1):
fn = sys.argv[1]
fileName = str(fn)
self.e.clear()
try:
f = open(fileName,'r')
except:
return
for l in f.readlines():
self.e.append(l)
f.close()
self.setCaption(fileName)
self.statusBar().message('Loaded document %s' % (fileName),2000)
else:
pass
def pyqon(self):
QMessageBox.about(self,'PyTe',
'The application is now running in console mode,<br>close the console to return to PyTe.')
from pyqon.main import run
run()
def qt3(self):
print os.system('designer-qt3')
def qt4(self):
print os.system('designer-qt4')
def Atmega168(self):
filename = QFileDialog.getOpenFileName("","*.hex", self,"FileDialog")
print os.system('avrdude -p m168 -c stk500v2 -P /dev/ttyACM0 -U flash:w: %s'%(filename))
def Atmega328(self):
filename = QFileDialog.getOpenFileName("","*.hex", self,"FileDialog")
print os.system('avrdude -p m328 -c stk500v2 -P /dev/ttyACM0 -U flash:w: %s'%(filename))
def pyuic(self):
filename = QFileDialog.getOpenFileName("", "*.ui", self,"FileDialog")
filename1 = QFileDialog.getSaveFileName("", "*.py", self,"FileDialog1")
print os.system('cd %s'%(filename))
print os.system('pyuic %s'%(filename)%'%s > %s'%(filename1))
def bash(self):
lexb = QextScintillaLexerBash(self)
self.e.setLexer(lexb)
self.statusBar().message('Lexer set to Bash',2000)
def cpp(self):
lexc = QextScintillaLexerCPP(self)
self.e.setLexer(lexc)
self.statusBar().message('Lexer set to C++',2000)
def css(self):
lexcs = QextScintillaLexerCSS(self)
self.e.setLexer(lexcs)
self.statusBar().message('Lexer set to CSS',2000)
def html(self):
lexh = QextScintillaLexerHTML(self)
self.e.setLexer(lexh)
self.statusBar().message('Lexer set to HTML PHP',2000)
def perl(self):
lexp = QextScintillaLexerPerl(self)
self.e.setLexer(lexp)
self.statusBar().message('Lexer set to Perl',2000)
def python(self):
lexpy = QextScintillaLexerPython(self)
self.e.setLexer(lexpy)
self.statusBar().message('Lexer set to Python',2000)
def ruby(self):
lexr = QextScintillaLexerRuby(self)
self.e.setLexer(lexr)
self.statusBar().message('Lexer set to Ruby',2000)
def tex(self):
lext = QextScintillaLexerTeX(self)
self.e.setLexer(lext)
self.statusBar().message('Lexer set to TeX',2000)
def split(self):
ssci = QSci(self.splitter)
ssci.setDocument(self.e.document())
ssci.show()
def run(self):
filename=QFileDialog.getOpenFileName("", "*.py", self,"FileDialog")
print os.system('python %s' % (filename))
def new1(self):
ed = Form2()
ed.show()
editorList.append(ed)
def open1(self):
fn=QFileDialog.getOpenFileName("", "*.py *.cpp *.sh *.pl *.rb *.html *.c *.css *.txt *.php *.xml", self, "FileDialog")
if fn.isEmpty():
self.statusBar().message('Loading aborted',2000)
return
fileName = str(fn)
self.e.clear()
try:
f = open(fileName,'r')
except:
return
for l in f.readlines():
self.e.append(l)
f.close()
self.setCaption(fileName)
self.statusBar().message('Loaded document %s' % (fileName),2000)
# self.e.setEdited(0)
def save1(self):
fn = QFileDialog.getSaveFileName("", "*.py *.cpp *.sh *.pl *.rb *.html *.c *.css *.txt *.php *.xml", self, "FileDialog")
try:
f = open(str(fn),'w+r')
except:
self.statusBar().message('Could not write to %s' % (fn),2000)
return
f.write(str(self.e.text()))
f.close()
# self.e.setEdited(0)
self.setCaption(self.fn)
self.statusBar().message('File %s saved' % (self.fn),2000)
def saveas(self):
fn = QFileDialog.getSaveFileName("", "*.py *.cpp *.sh *.pl *.rb *.html *.c *.css *.txt *.php *.xml", self, "FileDialog")
if not fn.isEmpty():
f = open(str(fn),'w+r')
f.write(str(self.e.text()))
f.close()
else:
self.statusBar().message('Saving aborted',2000)
def printdoc(self):
Margin = 10
pageNo = 1
if self.printer.setup(self):
self.statusBar().message('Printing...')
p = QPainter()
p.begin(self.printer)
p.setFont(self.e.font())
yPos = 0
fm = p.fontMetrics()
metrics = QPaintDeviceMetrics(self.printer)
for i in range(self.e.numLines):
if Margin + yPos > metrics.height() - Margin:
pageNo = pageNo + 1
self.statusBar().message('Printing (page %d)...' % (pageNo))
self.printer.newPage()
yPos = 0
p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.e.textLine(i))
yPos = yPos + fm.lineSpacing()
p.end()
self.statusBar().message('Printing completed',2000)
else:
self.statusBar().message('Printing aborted',2000)
def closeevent(self, ce):
if not self.e.isModified():
ce.accept()
return
rc = QMessageBox.information(self,'PyTe',
'The document has been changed since the last save.',
'Save','Cancel','Do not Save',0,1)
if rc == 0:
self.save1()
ce.accept()
elif rc == 2:
ce.accept()
else:
ce.ignore()
def about(self):
QMessageBox.about(self,'PyTe',
'PyTe is a Source Code Editor, <br> you can also run python scripts with it.<br> Avrdude file upload with stk500v2 programmer for the Atmega168 and Atmega328<br>has been added from version 2.2.3b, hope it works<br> Ver.2.2.4b')
def aboutQt(self):
QMessageBox.aboutQt(self,'PyTe')
def languageChange(self):
self.setCaption(self.__tr("PyTe"))
self.fileNewAction.setText(self.__tr("New"))
self.fileNewAction.setMenuText(self.__tr("&New"))
self.fileNewAction.setAccel(self.__tr("Ctrl+N"))
self.fileOpenAction.setText(self.__tr("Open"))
self.fileOpenAction.setMenuText(self.__tr("&Open..."))
self.fileOpenAction.setAccel(self.__tr("Ctrl+O"))
self.fileSaveAction.setText(self.__tr("Save"))
self.fileSaveAction.setMenuText(self.__tr("&Save"))
self.fileSaveAction.setAccel(self.__tr("Ctrl+S"))
self.fileSaveAsAction.setText(self.__tr("Save As"))
self.fileSaveAsAction.setMenuText(self.__tr("Save &As..."))
self.fileSaveAsAction.setAccel(QString.null)
self.filePrintAction.setText(self.__tr("Print"))
self.filePrintAction.setMenuText(self.__tr("&Print..."))
self.filePrintAction.setAccel(self.__tr("Ctrl+P"))
self.fileExitAction.setText(self.__tr("Exit"))
self.fileExitAction.setMenuText(self.__tr("E&xit"))
self.fileExitAction.setAccel(QString.null)
self.editUndoAction.setText(self.__tr("Undo"))
self.editUndoAction.setMenuText(self.__tr("&Undo"))
self.editUndoAction.setAccel(self.__tr("Ctrl+Z"))
self.editRedoAction.setText(self.__tr("Redo"))
self.editRedoAction.setMenuText(self.__tr("&Redo"))
self.editRedoAction.setAccel(self.__tr("Ctrl+Y"))
self.editCutAction.setText(self.__tr("Cut"))
self.editCutAction.setMenuText(self.__tr("Cu&t"))
self.editCutAction.setAccel(self.__tr("Ctrl+X"))
self.editCopyAction.setText(self.__tr("Copy"))
self.editCopyAction.setMenuText(self.__tr("&Copy"))
self.editCopyAction.setAccel(self.__tr("Ctrl+C"))
self.editPasteAction.setText(self.__tr("Paste"))
self.editPasteAction.setMenuText(self.__tr("&Paste"))
self.editPasteAction.setAccel(self.__tr("Ctrl+V"))
self.editFindAction.setText(self.__tr("Find"))
self.editFindAction.setMenuText(self.__tr("&Find..."))
self.editFindAction.setAccel(self.__tr("Ctrl+F"))
self.helpContentsAction.setText(self.__tr("Contents"))
self.helpContentsAction.setMenuText(self.__tr("&Contents..."))
self.helpContentsAction.setAccel(QString.null)
self.helpIndexAction.setText(self.__tr("About PyTe"))
self.helpIndexAction.setMenuText(self.__tr("&About PyTe"))
self.helpIndexAction.setAccel(QString.null)
self.helpAboutAction.setText(self.__tr("About QT"))
self.helpAboutAction.setMenuText(self.__tr("&About QT"))
self.helpAboutAction.setAccel(QString.null)
self.lexerBashAction.setText(self.__tr("Bash"))
self.lexerBashAction.setMenuText(self.__tr("Bash"))
self.lexerCAction.setText(self.__tr("C++"))
self.lexerCAction.setMenuText(self.__tr("C++"))
self.lexerCSSAction.setText(self.__tr("CSS"))
self.lexerCSSAction.setMenuText(self.__tr("CSS"))
self.lexerHTMLAction.setText(self.__tr("HTML PHP"))
self.lexerHTMLAction.setMenuText(self.__tr("HTML PHP"))
self.lexerPerlAction.setText(self.__tr("Perl"))
self.lexerPerlAction.setMenuText(self.__tr("Perl"))
self.lexerPythonAction.setText(self.__tr("Python"))
self.lexerPythonAction.setMenuText(self.__tr("Python"))
self.lexerRubyAction.setText(self.__tr("Ruby"))
self.lexerRubyAction.setMenuText(self.__tr("Ruby"))
self.lexerTexAction.setText(self.__tr("TeX"))
self.lexerTexAction.setMenuText(self.__tr("TeX"))
self.toolBar.setLabel(self.__tr("Tools"))
self.pushButton2.setText(self.__tr("Run Python Script"))
self.pushButton14.setText(self.__tr("QT3"))
self.pushButton15.setText(self.__tr("QT4"))
self.pushButton16.setText(self.__tr("Atmega168"))
self.pushButton17.setText(self.__tr("Atmega328"))
self.Toolbar.setLabel(self.__tr("Toolbar"))
self.pushButton9.setText(self.__tr("Bash"))
self.pushButton4.setText(self.__tr("C++"))
self.pushButton10.setText(self.__tr("CSS"))
self.pushButton8.setText(self.__tr("HTML PHP"))
self.pushButton6.setText(self.__tr("Perl"))
self.pushButton11.setText(self.__tr("Python"))
self.pushButton5.setText(self.__tr("Ruby"))
self.pushButton12.setText(self.__tr("TeX"))
self.pushButton13.setText(self.__tr("Split"))
if self.MenuBar.findItem(1):
self.MenuBar.findItem(1).setText(self.__tr("&File"))
if self.MenuBar.findItem(2):
self.MenuBar.findItem(2).setText(self.__tr("&Edit"))
if self.MenuBar.findItem(3):
self.MenuBar.findItem(3).setText(self.__tr("&Help"))
if self.MenuBar.findItem(4):
self.MenuBar.findItem(4).setText(self.__tr("Lexer"))
def __tr(self,s,c = None):
return qApp.translate("Form2",s,c)
if __name__ == "__main__":
app = QApplication(sys.argv)
f = Form2()
splash = SplashScreen()
app.setMainWidget(splash)
splash.message(qApp.translate("PyTe", "Generating Main Window..."))
if splash:
del splash
f.show()
app.setMainWidget(f)
app.exec_loop()
import os.path
from qt import *
from config import getConfig
class SplashScreen(QVBox):
def __init__(self):
QVBox.__init__(self, None, "splash",
Qt.WDestructiveClose | Qt.WStyle_Customize | Qt.WStyle_NoBorder |\
Qt.WX11BypassWM | Qt.WStyle_StaysOnTop)
self.setFrameStyle(QFrame.Plain)
PyTe = QPixmap(os.path.join(getConfig('Pix'), 'PyTe.png'))
pic = QLabel(self, "splashpic")
pic.setPixmap(PyTe)
self.msg = QLabel(self)
self.msg.setIndent(6)
self.msg.setPaletteBackgroundColor(Qt.black)
self.msg.setPaletteForegroundColor(Qt.white)
self.msg.setFrameStyle(QFrame.Plain)
self.adjustSize()
screen = QApplication.desktop().screenGeometry()
self.move(QPoint(screen.center().x() - self.width()/2,
screen.center().y() - self.height()/2))
self.show()
qApp.processEvents()
def message(self, msg):
self.msg.setText(msg)
qApp.processEvents()
class NoneSplashScreen:
def __init__(self):
pass
def message(self, msg):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment