예제 #1
0
 def initEnvy(self):
     try:
         import envy
         envy.set_app_system(1)
         if self.c('hidden') == 1:
             envy.set_app_hidden(1)
     except:
         self.printStackTrace()
예제 #2
0
    def __init__(s):
        import appuifw, sysinfo, akntextutils, os, e32dbm, os, envy
        from graphics import Image
        s.appuifw, s.e32, s.Image, s.akntextutils, s.os, s.e32dbm = appuifw, appuifw.e32, Image, akntextutils, os, e32dbm
        envy.set_app_system(1)
        s.appuifw.app.screen = "full"
        s.screen_size = sysinfo.display_pixels()
        s.path = mypath
        s.sokoban = Sokoban()
        s.canvas = s.appuifw.Canvas(s.redraw0, s.events)
        s.appuifw.app.body = s.canvas
        s.appuifw.app.exit_key_handler = s.exit
        del appuifw, Image, sysinfo, akntextutils, os, envy

        s.start()
예제 #3
0
 def settings(self):
     size=[u'normal', u'full', u'large']
     pick=[u'Yes', u'No']
     opt=[True, False]
     data=[
         (u'Screen size', 'combo', (size, size.index(self.screen))),
         (u'Set as system app', 'combo', (pick, opt.index(self.system))),
         (u'Save last path', 'combo', (pick, opt.index(self.lastpath))),
         (u'Text Size', 'combo', (self.fonts.keys(), self.fonts.keys().index(self.font_type))), 
         (u'Text Color', 'combo', (self.colors.keys(), self.colors.keys().index(self.color_type))), 
         (u'Set password', 'text', unicode(self.pw))
         ]
     flag=ui.FFormEditModeOnly|ui.FFormDoubleSpaced
     def save(args):
         ui.note(u'processing')
     form=ui.Form(data, flag)
     form.save_hook=save
     old=ui.app.title
     ui.app.title=u'Configurations'
     form.execute()
     self.screen=(form[0][2][0][form[0][2][1]]).encode('u8')
     self.system=opt[form[1][2][1]]
     self.lastpath=opt[form[2][2][1]]
     self.font_type=self.fonts.keys()[form[3][2][1]]
     self.font=self.fonts[self.font_type]
     self.color_type=self.colors.keys()[form[4][2][1]]
     self.color=self.colors[self.color_type]
     self.pw=form[5][2]
     pwd=self.pw.encode('base64').strip()
     e32.ao_yield()
     ini=file(self.pre+'ini.ini', 'w')
     ini.write(self.screen+'\n'+str(self.system)+'\n'+str(self.lastpath)+'\n'+self.font_type+'\n'+self.color_type+'\n'+pwd+'\nNone\nNone')
     e32.ao_yield()
     ini.close()
     ui.app.title=old
     ui.note(u'saved', 'conf')
     ui.app.screen=self.screen
     envy.set_app_system(self.system)
     return 1
예제 #4
0
파일: __init__.py 프로젝트: 4udak/ped-s60
def apply_settings(self):
    old_apply_settings(self)
    set_app_system(self.settings.plugins.system_app)
예제 #5
0
path1 = os.getcwd()
index = path1.rfind('\\')
mypath = path1[:index]
index = mypath.rfind('\\')
mypath = mypath[:index]
#mypath2=path1+'\\src\\'
sys.path.append(mypath)
#sys.path.append(mypath2)

import appuifw, graphics, e32

#disk=appuifw.app.full_name()[0]
path = mypath + "\\PJchat_v1.3_src(Build20110906)\\"
try:
    import envy
    envy.set_app_system(1)
except:
    pass
cn = lambda x: x  #.decode("u8")
appuifw.app.screen = "full"
appuifw.app.body = body = appuifw.Canvas()
x, y = body.size
if x == 240:
    enterimg = graphics.Image.open(path + "Images\\enterimg1.jpg").resize(
        (x, y))
    enterimg.text((x / 4, y / 1.4), cn("程 序 初 始 化 中 …"), 0, ("dense", 16))
else:
    enterimg = graphics.Image.open(path + "Images\\enterimg2.jpg").resize(
        (x, y))
    enterimg.text((x / 2, y / 1.4), cn("程 序 初 始 化 中 …"), 0, ("dense", 16))
body.blit(enterimg)
예제 #6
0
def setSystem(type=1):
  import envy
  envy.set_app_system(type)
  del envy,type
예제 #7
0
import keycapture
import e32, appuifw
import key_codes
import appswitch
s60_version = e32.s60_version_info[0]
if s60_version == 3:
    from envy import set_app_system
    set_app_system(1)

appname = appswitch.application_list(0)[0]
key = []
for i in dir(key_codes):
    if i.startswith('E'):
        key.append(eval('key_codes' + '.' + i))
rung = 1


class Key:
    def __init__(s):
        s.press = keycapture.KeyCapturer(s.key_callback)
        s.press.keys = (key)

    def start(s):
        s.press.start()

    def key_callback(s, key):
        global rung
        print key
        if key == 8:
            rung = 0
            print 'Exit'
예제 #8
0
def apply_settings(self):
    old_apply_settings(self)
    set_app_system(self.settings.plugins.system_app)
예제 #9
0
파일: default.py 프로젝트: Symbian9/pjchat
#-*- coding:utf-8 -*-
#泡椒聊天启动程序
#Powered By 52cyy℡
#PJChat_v1.3(Build20110906)

import appuifw,graphics,e32

disk=appuifw.app.full_name()[0]
path=disk+":\\system\\Apps\\PJChat\\"
try:
    import envy
    envy.set_app_system(1)
except:pass

appuifw.app.screen="full"
appuifw.app.body=body=appuifw.Canvas()
x,y=body.size
if x==240:
    enterimg=graphics.Image.open(path+"Images\\enterimg1.jpg").resize((x,y))
    enterimg.text((x/4,y/1.4),"程 序 初 始 化 中 …".decode("utf8"),0,("dense",16))
else:
    enterimg=graphics.Image.open(path+"Images\\enterimg2.jpg").resize((x,y))
    enterimg.text((x/2,y/1.4),"程 序 初 始 化 中 …".decode("utf8"),0,("dense",16))
body.blit(enterimg)
appuifw.app.menu=[]
appuifw.app.exit_key_handler=lambda:None
del enterimg
e32.ao_yield()
try:
    import PJChatMain
    Run=PJChatMain.MainPageUI()
예제 #10
0
 def __init__(self):
     self.pre=os.path.dirname(ui.app.full_name())+'\\'
     self.lock=e32.Ao_lock()
     try:
         ini=file(self.pre+'ini.ini').read().split('\n')
         self.screen, self.system, self.lastpath, self.font_type, self.color_type, self.pw, self.pat, self.cur=ini[0], int(ini[1]), int(ini[2]), ini[3], ini[4], ini[5].decode('base64'), ini[6], ini[7]
         e32.ao_yield()
         if len(self.pw)!=0:
             p=ui.query(u'enter password:'******'code')
             if p != self.pw or not p:
                 ui.note(u'password error', 'error')
                 os.abort()
     except:
         self.screen, self.system, self.lastpath, self.font_type, self.color_type, self.pw, self.pat, self.cur='normal', 0, 0, u'Normal', u'Blue', u'', 'None', 'None'
         ini=file(self.pre+'ini.ini', 'w')
         ini.write('normal\n0\n0\nNormal\nBlue\n\nNone\nNone')
         e32.ao_yield()
         ini.close()
     self.drive_icon=ui.Icon(self.pre+u'myicons.mbm', 0, 1)
     self.folder_icon=ui.Icon(self.pre+u'myicons.mbm', 2, 3)
     self.py=('py', 'pyc', 'pyd', 'dll', 'cc', 'c', 'cpp', 'h')
     self.py_icon=ui.Icon(self.pre+u'myicons.mbm', 4, 5)
     self.wait_icon=ui.Icon(self.pre+u'myicons.mbm', 6, 7)
     self.empty_icon=ui.Icon(self.pre+u'myicons.mbm', 8, 9)
     self.zip=('zip', 'rar', 'tar', 'bz2', '7z', 'gz', 'tgz')
     self.zip_icon=ui.Icon(self.pre+u'myicons.mbm', 10, 11)
     self.img=('jpg', 'jpeg', 'gif', 'png', 'bmp')
     self.img_icon=ui.Icon(self.pre+u'myicons.mbm', 18, 19)
     self.vid=('3gp', 'avi', 'mp4', 'mkv')
     self.vid_icon=ui.Icon(self.pre+u'myicons.mbm', 20, 21)
     self.music=('mp3', 'mid', 'midi', 'aac', 'ogg', 'wma', 'amr', 'wav', 'm4a')
     self.music_icon=ui.Icon(self.pre+u'myicons.mbm', 22, 23)
     self.exe=('exe', 'app')
     self.exe_icon=ui.Icon(self.pre+u'myicons.mbm', 24, 25)
     self.pdf=('pdf',)
     self.pdf_icon=ui.Icon(self.pre+u'myicons.mbm', 28, 29)
     self.web=('html', 'xhtml', 'htm', 'xml', 'wml', 'js', 'php', 'asp', 'aspx')
     self.web_icon=ui.Icon(self.pre+u'myicons.mbm', 14, 15)
     self.doc=('doc', 'docx', 'xls', 'mobi', 'prc')
     self.doc_icon=ui.Icon(self.pre+u'myicons.mbm', 12, 13)
     self.text=('txt', 'css', 'lrc')
     self.text_icon=ui.Icon(self.pre+u'myicons.mbm', 32, 33)
     self.other_icon=ui.Icon(self.pre+u'myicons.mbm', 34, 35)
     self.install=('sis', 'sisx', 'jar', 'jad')
     self.install_icon=ui.Icon(self.pre+u'myicons.mbm', 36, 37)
     entry=[(u'C:', self.drive_icon)]
     self.fonts={u'Small':(u'LatinPlain12', 10), 
         u'Normal':(u'Alp13', 12),
         u'Large':(u'Alp17', 15)}
     self.colors={u'Red':0xaa0000, 
         u'Green':0x00aa00, 
         u'Blue':0x0000aa, 
         u'Black':0x0,
         u'Purple':0xaa00aa, 
         u'Grey':0x808080}
     self.dic={self.music: self.music_icon, 
         self.img: self.img_icon, 
         self.zip: self.zip_icon, 
         self.py: self.py_icon, 
         self.pdf: self.pdf_icon, 
         self.vid: self.vid_icon, 
         self.install: self.install_icon, 
         self.exe: self.exe_icon, 
         self.web: self.web_icon, 
         self.doc: self.doc_icon, 
         self.text: self.text_icon}
     e32.ao_yield()
     self.lb=ui.Listbox(entry, self.rightArrow)
     self.count=0
     ui.app.screen=self.screen
     envy.set_app_system(self.system)
     self.font=self.fonts[self.font_type]
     self.color=self.colors[self.color_type]
예제 #11
0
파일: UBBEdit.py 프로젝트: Symbian9/pycoder
    def __init__(self):
        try:
            from envy import set_app_system
            set_app_system(1)
        except:
            ui.note(cn('  注意:由于缺少envy模块,不能直接挂到后台,注意保存!'), 'info')
        #
        from socket import access_points, access_point, select_access_point, set_default_access_point
        self.aps = access_points()  #接入点列表
        self.apid = {}
        self.ap = None

        self.txt_size = 0
        ui.app.title = cn(_name)
        ui.app.body = self.t = ui.Text()
        ui.app.exit_key_handler = self.exit_edit
        self.t.bind(63557, self.addn)
        self.t.bind(63586, self.pop_menu)
        self.menu_list = [
            (cn('文件'), ((cn('新建'), self.new), (cn('打开'), self.read),
                        (cn('保存'), self.save))), (cn('表情'), self.face),
            (cn('转换'), self.rep), (cn('还原'), self.rerep),
            (
                cn('超链'),
                ((cn('插入帖链'), self.bto_url), (cn('直接输入URL'), self.url)),
            ), (cn('图链'), ((cn('输入地址'), self.img), )),
            (cn('社区专用UBB'), (
                (cn('加粗'), lambda: self.add_ubb('b')),
                (cn('下划线'), lambda: self.add_ubb('u')),
                (cn('斜体'), lambda: self.add_ubb('i')),
                (cn('电话'), lambda: self.add_ubb('tel')),
                (cn('日期'), lambda: self.add_ubb('date')),
                (cn('时间'), lambda: self.add_ubb('time')),
                (cn('农历图片'), lambda: self.add_ubb('cct')),
            ))
        ]
        self.pop_menu_list = [
            cn('复制到UC'),
            cn('发表'),
            cn('上翻'),
            cn('下翻'),
            cn('设置'),
            cn('帮助')
        ]
        ui.app.menu = self.menu_list
        self.setting = [
            u'14',  #字体
            u'250,100,100',  #颜色
            u'',  #LXT
            u'5690:PyS\u7f16\u7a0b\u4e13\u533a,6019:\u7834\u89e3\u4e13\u533a',
            u'64:\u5973\u4eba\u5fc3\u4e8b,222:\u7537\u5b69\u522b\u54ed',
            u' ',  #空格
            None,  #接入点
            u'e:\\sys\\bin\\UcWeb60signed.exe'
        ]  #UC路径
        self.sett('read')
        self.up_setting()
        self.face_list = [
            cn('胜利'),
            cn('摆酷'),
            cn('暴汗'),
            cn('晕了'),
            cn('大笑'),
            cn('脸红'),
            cn('偷笑'),
            cn('流泪'),
            cn('色色'),
            cn('惊讶'),
            cn('抽烟'),
            cn('疑问'),
            cn('调皮'),
            cn('飞吻'),
            cn('愤怒'),
            cn('害羞'),
            cn('别吵'),
            cn('欢迎'),
            cn('微笑'),
            cn('睡觉'),
            cn('送花'),
            cn('闭嘴'),
            cn('再见'),
            cn('擦汗'),
            cn('发呆'),
            cn('可怜'),
            cn('捉狂'),
            cn('亲亲'),
            cn('鄙视'),
            cn('咒骂'),
            cn('好困')
        ]