コード例 #1
0
    def __init__(self):
        self.lock = e32.Ao_lock()
        self.text = appuifw.Text(u"")
        self.text.font = "normal"
        self.accessPointId = None
        self.accessPoint = None

        appuifw.app.screen = "normal"
        appuifw.app.menu = [(u"Translate", self.onTranslate)]
        appuifw.app.title = u"Translate"
        appuifw.app.body = self.text
        appuifw.app.exit_key_handler = self.onExit

        self.lock.wait()
コード例 #2
0
    def run(self):
        self.app_lock = e32.Ao_lock()

        appuifw.app.title = APPNAME

        appswitch.switch_to_bg(APPNAME)

        appuifw.app.body = appuifw.Text()

        appuifw.app.menu = self.createMenu()

        appuifw.app.exit_key_handler=self.quit

        self.app_lock.wait()
コード例 #3
0
    def __init__(self, app2):
        self.lock = e32.Ao_lock()

        self.app2 = app2
        self.old_title = appuifw.app.title
        appuifw.app.title = u"GSM Location"

        self.exit_flag = False
        appuifw.app.exit_key_handler = self.abort

        self.db = gsm_location(app2)

        appuifw.app.body = appuifw.Text()
        appuifw.app.menu = [(u"Refresh", self.refresh)]
コード例 #4
0
ファイル: QQmsg_new.py プロジェクト: Symbian9/pycoder
def uc():
    alist()
    if os.path.exists('e:\\system\\apps\\qqmsg\\data.py'):
        wat = appuifw.query(cn('作者与Ucweb合作,支持作者,下载并成功联网使用一次,作者就会得到奖励,是否下载Ucweb最新版?'), 'query')
        if (wat != None):
            appuifw.note(cn('您的支持就是我们最大的动力。谢谢!\n系统正在为你载入,请稍候……'), 'info')
            try:
                e32.start_exe('z:\\system\\programs\\apprun.exe', 'z:\\system\\apps\\Browser\\Browser.app "http://down2.ucweb.com/download.asp?f=cuijun@ltzwj&url=&title="')
            except:
                appuifw.app.body = uctxt = appuifw.Text(cn('\n载入失败,请手动下载。\nhttp://down2.ucweb.com/download.asp?f=cuijun@ltzwj&url=&title='))
                appuifw.app.menu = [(cn('返回'),
                  uc)]
                appuifw.app.exit_key_handler = uc
            os.remove('e:\\system\\apps\\qqmsg\\data.py')
コード例 #5
0
 def __init__(self, netbios_hostname=None):
     #appuifw.app.screen = 'large'
     self.password = None
     self.username = None
     self.debug = False
     self.error_retry = 0
     self.config = config()
     self.set_title()
     self.apn = socket.select_access_point()
     self.dest_name = netbios_hostname
     self.set_host(netbios_hostname)
     #self.connect()
     self.set_menus()
     self.download_textinfo = appuifw.Text()
     self.download_textinfo.style = appuifw.STYLE_BOLD
コード例 #6
0
ファイル: default.py プロジェクト: Symbian9/pycoder
def about():
    appuifw.app.screen = 'full'
    appuifw.app.body = tt = appuifw.Text()
    tt.set(
        cn('\n此版本号为V0.3.2,专为八神智能天下--6.10更新打造,您可按个人须要而对作品进行修改或发布。但必须征得本人同意的情况下进行,请您自觉尊守。\n为了使此作品更人性化,如有必要的修改或发现Bug,请上报。我会尽量满足您的要求或更改。\n最后祝您使用愉快!!\n更多资源请手机登陆:\nwap.8Zntx.Com    /by:捞坚。\n\n\n\n'
           ))
    tt.add(
        u'******\u611f\u8c22\u4f7f\u7528\u635e\u575a\u4f5c\u54c1******\n\n                  \u590d\u5236\u8bf7\u6309    \n     \u201c\u7b14\u5f62\u952e\u201d\u002b\u201c\u5bfc\u822a\u952e\u201d'
    )
    tt.color = 0xff0000
    tt.add(
        u'\n\n  \u6362\u884c\u4ee3\u7801\u5feb\u6377\u952e\u4e3a\u5bfc\u822a\u4e2d\u5fc3\u952e\n\n\u5173\u4e8e\u4f5c\u54c1\u8bf7\u6309\u53f3\u952e\u7ee7\u7eed\u003e\u003e\u003e\n\n'
    )
    appuifw.app.menu = [(cn('进入编贴助手'), txt), (cn('返回'), alist)]
    appuifw.app.exit_key_handler = alist
コード例 #7
0
 def __init__(self, feedlist):
     self.lock = e32.Ao_lock()
     self.exit_flag = False
     self.old_exit_key_handler = appuifw.app.exit_key_handler
     self.old_app_body = appuifw.app.body
     appuifw.app.exit_key_handler = self.handle_exit
     self.feeds = feedlist
     self.articleviewer = appuifw.Text()
     self.feedmenu = appuifw.Listbox([u''], self.handle_feedmenu_select)
     self.articlemenu = appuifw.Listbox([u''],
                                        self.handle_articlemenu_select)
     screenmodemenu = (u'Screen mode',
                       ((u'full', lambda: handle_screen('full')),
                        (u'large', lambda: handle_screen('large')),
                        (u'normal', lambda: handle_screen('normal'))))
     self.statemap = {
         'feedmenu': {
             'menu': [(u'Update this feed', self.handle_update),
                      (u'Update all feeds', self.handle_update_all),
                      (u'Debug', self.handle_debug), screenmodemenu,
                      (u'Exit', self.abort)],
             'exithandler':
             self.abort
         },
         'articlemenu': {
             'menu': [(u'Update this feed', self.handle_update),
                      (u'Update all feeds', self.handle_update_all),
                      screenmodemenu, (u'Exit', self.abort)],
             'exithandler':
             lambda: self.goto_state('feedmenu')
         },
         'articleview': {
             'menu': [(u'Next article', self.handle_next),
                      (u'Previous article', self.handle_prev),
                      screenmodemenu, (u'Exit', self.abort)],
             'exithandler':
             lambda: self.goto_state('articlemenu')
         }
     }
     self.articleviewer.bind(EKeyDownArrow, self.handle_downarrow)
     self.articleviewer.bind(EKeyUpArrow, self.handle_uparrow)
     self.articleviewer.bind(EKeyLeftArrow, self.handle_exit)
     self.articlemenu.bind(EKeyRightArrow, self.handle_articlemenu_select)
     self.articlemenu.bind(EKeyLeftArrow, self.handle_exit)
     self.feedmenu.bind(EKeyRightArrow, self.handle_feedmenu_select)
     for k in self.feeds:
         k.listen(self.notify)
     self.goto_state('feedmenu')
コード例 #8
0
 def parcebin(self):
  bin=self.binary
  self.t=ui.Text();self.t.color=0x000000;self.t.font=self.get_db('font', 'tuple')
  try:
   self.t.set(u(bin))
  except UnicodeError:
   try:
    bin.decode('ascii')
    self.t.set(bin)
   except:
    self.t=None
  except SymbianError, e:
   if e.errno==-4:
    ui.note(u'OutOfMemory, splitting file into chunks', 'error')
    app.set_tabs([u'1', u'2',u'3'],self.dummy)
    self.binary=bin[:1024];self.parcebin()
 def __init__(self,
              type,
              item,
              parent=None,
              callback=None,
              menu=None,
              help=None):
     self.parent = parent
     if type == "list":
         self.uicontrol = appuifw.Listbox(item, callback)
     elif type == "text":
         self.uicontrol = appuifw.Text(item)
     else:
         self.uicontrol = None
     self.menu = menu
     self.help = help
コード例 #10
0
ファイル: imageTagger.py プロジェクト: nesl/soundscape
	def initImager(self):

		if(self.captureImage == 1):
	                textScreen = appuifw.Text()
                	textScreen.font = 'normal'
			msgText = u'You are currently capturing images.'
			msgText += u'The view finder cannot be shown until you stop capturing'
			msgText += u' and go back to the image screen.'
                	textScreen.add(msgText)
                	appuifw.app.body = textScreen
		else:
			self.imagerOn = 1
			def cameraBuffer(image):
				appuifw.app.body.blit(image)

			appuifw.app.body = appuifw.Canvas()
			camera.start_finder(cameraBuffer) 
コード例 #11
0
ファイル: test_appuifw.py プロジェクト: zixing131/pys60_doc
def test_text_widget():
    text_styles = {'bold': appuifw.STYLE_BOLD, 'italic': appuifw.STYLE_ITALIC,
                   'underline': appuifw.STYLE_UNDERLINE,
                   'strikethrough': appuifw.STYLE_STRIKETHROUGH}
    text_highlight = {'standard': appuifw.HIGHLIGHT_STANDARD,
                      'rounded': appuifw.HIGHLIGHT_ROUNDED,
                      'shadow': appuifw.HIGHLIGHT_SHADOW}

    def text_callback():
        appuifw.note(u"Text callback hit!")

    old_body1 = appuifw.app.body
    appuifw.app.body = t = appuifw.Text()
    t.font = appuifw.available_fonts()[0]
    t.color = 0x004000 # Dark green

    appuifw.note(u"Testing different styles")
    for style in text_styles:
        for highlight in text_highlight:
            appuifw.note(u"Setting style: " + unicode(style) + " Highlight: " +
                         unicode(highlight))
            t.style = (text_styles[style] | text_highlight[highlight])
            t.set(u"This is a dummy text written using the set command. ")
            e32.ao_sleep(2)

    e32.ao_sleep(2)
    appuifw.note(u"Adding some more text...")
    t.add(u"Appending more text using add command")
    e32.ao_sleep(2)
    appuifw.note(u"Total length: " + unicode(t.len()))
    appuifw.note(u"Deleting 10 chars from pos 5")
    t.delete(5, 10)
    e32.ao_sleep(2)
    appuifw.note(u"Current cursor position : " + unicode(t.get_pos()))
    appuifw.note(u"Setting the cursor pos to 0")
    t.set_pos(0)
    e32.ao_sleep(2)
    appuifw.note(u"Clearing text contents")
    t.clear()
    e32.ao_sleep(2)
    t.bind(EKeyEnter, text_callback)
    appuifw.note(u"Enter key is bound to a function. Press it now!")
    t.set(u"Sleeping for 5 secs")
    e32.ao_sleep(5)
    appuifw.note(u"Testing of Text widget is complete.")
    appuifw.app.body = old_body1
コード例 #12
0
def get_image():
    global user_name
    global image_dir, old_files, old_focus
    imageScreen = appuifw.Text()
    imageScreen.add(u'Hi ' + user_name + '.\n\n')
    imageScreen.add(u'Great job collecting that information.\n\n')
    imageScreen.add(
        u'Now please take a representative image of the demo that shows its uniqueness or value.'
    )
    imageScreen.add(u'\n\nPress and hold the camera button to start capture.')
    image_dir = dir_iter.Directory_iter([
        u'e:\\Images',
    ])
    image_dir.add(0)
    old_files = get_files()

    old_focus = appuifw.app.focus
    appuifw.app.focus = image_focus
    appuifw.app.body = imageScreen
コード例 #13
0
ファイル: translate.py プロジェクト: eboladev/etc
    def __init__(self):
        appuifw.app.screen = "normal"
        appuifw.app.menu = [(u"Translate", self.onTranslate),
                            (u"Source language", self.onSetSource),
                            (u"Target language", self.onSetTarget),
                            (u"Access point", self.onSetAccessPoint),
                            (u"Clear", self.onClear),
                            (u"Exit", self.onExit)]
        self.lock = e32.Ao_lock()
        self.text = appuifw.Text(u"")
        self.text.font = "normal"
        self.source = "en"
        self.target = "da"
        self.uiLang = "en"
        self.sourceList = None
        self.targetList = None
        self.accessPointId = None
        self.accessPoint = None
        self.lastSensed = time.time()
        self.accelerometer = None
        self.minSensed = 0
        self.maxSensed = 0
        self.sensing = True
        self.sortedLanguageLists = {}
        
        self.restoreSettings()
        self.setTitle()
    
        appuifw.app.body = self.text
        appuifw.app.exit_key_handler = self.onExit

        # Install accelerometer sensor callback
        try:
            import sensor
            accInfo = sensor.sensors()['AccSensor']
            self.accelerometer = \
                sensor.Sensor(accInfo['id'], accInfo['category'])
            if 0: self.accelerometer.connect(self.onAccelerate)
        except:
            pass
        
        self.lock.wait()
コード例 #14
0
 def parcebin(self):
     bin = self.binary
     self.t = ui.Text()
     self.t.color = 0x000000
     self.t.font = (u"nokia hindi s60", 14, 16)
     try:
         self.t.set(u(bin))
     except UnicodeError:
         try:
             bin.decode('ascii')
             self.t.set(bin)
         except:
             self.t = None
     except SymbianError, e:
         if e.errno == -4:
             ui.note(u'OutOfMemory, splitting file into chunks', 'error')
             app.set_tabs([u'1', u'2', u'3'], self.dummy)
             self.ftp.retrbinary('RETR ' + self.sel[9], self.getbin,
                                 int(float(self.sel[5])) / 3)
             self.parcebin()
コード例 #15
0
def init_app():
    global user_name, demo_name, demo_novel, demo_new
    global num_vis, demo_rate, demo_comm, image_file

    demo_name = u''
    demo_novel = u''
    demo_new = u''
    num_vis = 0
    demo_rate = 1
    demo_comm = u''
    image_file = u''

    title = u'UCLA UrbanCENS'
    if (user_name == u''):
        intro = u'Welcome.'
        intro += u'Today, our campaign is to document other Ubicomp demos.'
        intro += u'\n\nIn the process, we hope to:\n'
        intro += u'\n- encourage interaction with authors'
        intro += u'\n- get user perspectives on demos'
        intro += u'\n- show partisans in action'
    else:
        intro = u'Welcome back, ' + user_name + u'.\n'
        intro += u'Thanks for documenting that last demo. '
        intro += u'When you are ready, lets document another.'

    cont = u'Press the center joystick to start.'

    textScreen = appuifw.Text()

    plainStyle = textScreen.style
    textScreen.font = 'title'
    textScreen.style = appuifw.STYLE_BOLD
    textScreen.add(title + '\n\n')
    textScreen.font = 'normal'
    textScreen.style = plainStyle
    textScreen.add(intro + '\n\n')
    textScreen.add(cont)

    textScreen.bind(EKeySelect, start_app)

    appuifw.app.body = textScreen
コード例 #16
0
def handle():
    global body
    body = appuifw.Text()
    body.color = 0

    appuifw.app.body = body

    global list
    curr = list.current()
    if curr == 0:
        appuifw.app.title = ru("API Key:")
        body.add(ru(sets.APIKEY))
    elif curr == 1:
        appuifw.app.title = ru("Username:"******"Password:")
        body.add(ru(sets.PASS))
    appuifw.app.menu = [(u'Save', lambda: save_text(curr)),
                        (u'Back', login_settings)]
    appuifw.app.exit_key_handler = lambda: save_text(curr)
コード例 #17
0
def createText():
    appuifw.app.body = None
    text = appuifw.Text()
    text.style = (appuifw.STYLE_BOLD | appuifw.STYLE_ITALIC
                  | appuifw.STYLE_UNDERLINE)
    text.font = "annotation"
    text.color = (255, 0, 0)
    text.add(u'My text...\n')
    text.font = "title"
    text.color = (255, 255, 0)
    text.add(u'My text...\n')
    text.font = "legend"
    text.color = (0, 0, 0)
    text.add(u'My text...\n')
    text.font = "dense"
    text.color = (0, 0, 255)
    text.add(u'My text...\n')
    text.font = "normal"
    text.color = (0, 255, 255)
    text.add(u'My text...\n')

    appuifw.app.body = text
コード例 #18
0
 def main(s):
     s.inlist=0
     ui.app.menu=[
         (cn("一键签到"),s.fastsign),
         (cn("辅助签到"),((cn("官方接口"),s.msign),(cn("精确签到"),s.selectsign))),
         (cn("设置"),((cn("添加贴吧"),s.changelist),(cn("设置帐号"),s.reset),(cn("重获cookie"),s.getcookie))),
         (cn("自动签到"),((cn("开启"),lambda:s.setauto(1)),(cn("关闭"),lambda:s.setauto(0)))),
         ((cn("帮助关于")),((cn("软件说明"),s.about),(cn("使用教程"),s.study))),
         (cn("退出程序"),s.exit)]
     ui.app.body=s.x=ui.Text()
     s.x.color=(0)
     s.x.set(cn("\n\n\t贴吧签到 v"+VER+"\n    \t\tby Light.紫.星\n"))
     ui.app.title=cn("贴吧签到")
     ui.app.exit_key_handler=s.exit
     try:
         isauto=open(path+"auto.ini").read()
     except:
         open(path+"auto.ini","w").write("0")
         isauto=open(path
         +"auto.ini").read()
     if(isauto=="0"):pass
     else:s.autosign()
コード例 #19
0
def exit():
    import random
    appuifw.app.body = m = appuifw.Text()
    appuifw.app.screen = 'full'
    m.clear()
    u = cn(
        '软件名称:智能编程Bata\n软件版本:1.0.0\n软件编辑:宇狼共舞\n测试机型:N73、6120C、N95\n软件介绍:智能编程是一款S60v3手机编程工具,需要py平台及其插件的支持,具有定义模板、傻瓜式操作,短短几天就能使你成为编程高手…使用简单,操作方便,功能实用。\nQQ:1003205747\n八神智能天下:8zntx.com'
    )
    x = 0
    color = [
        150150150, 204255255, 255204204, 255255153, 204204255, 153204204,
        255102102, 204255153, 255204204, 153153153, 593966, 255204153,
        175163200, 119116113, 111222000, 222111000, 210110001, 110120130,
        255255255, 240103512, 144000144
    ]
    while (x < len(u)):
        m.color = random.choice(color)
        m.add(u[x])
        x = (x + 1)
        e32.ao_sleep(3.7682853E-04)

    e32.ao_sleep(1)
    appuifw.app.set_exit()
コード例 #20
0
def app():
    global bodi
    appuifw.app.screen = 'normal'
    bodi = appuifw.Text()
    bodi.font = "title", 18
    bodi.color = 255, 0, 0
    bodi.add(u"Py Pastebin v1.00.1 by gauravssnl\n")
    appuifw.app.title = ru(title)
    appuifw.app.body = bodi
    appuifw.app.exit_key_handler = exit
    bodi.font = "title", 16
    bodi.color = 0, 0, 0
    bodi.add(u'I am just a student who failed in life.\n')
    bodi.add(
        u'Pastebin made easier.Share codes directly from files.To know more ,Click on "About"\n'
    )
    show()
    if sets.LOGIN == 0:
        if sets.APIKEY == "" or sets.USER == "" or sets.PASS == "":
            bodi.add(
                u"Go to Settings and enter your API,username and Password\n")
            appuifw.app.menu = [(ru("Login Settings"), login_settings),
                                (u'About', about), (ru("Exit"), exit)]
        else:
            bodi.add(u'>>you are not logged in\n')
            appuifw.app.menu = [(ru("Login"), login),
                                (ru("Login Settings"), login_settings),
                                (ru('Paste Settings'), settings),
                                (u'About', about), (ru("Exit"), exit)]

    elif sets.LOGIN == 1:
        bodi.add(ru('>>You are logged in\n'))

        appuifw.app.menu = [(ru("Create New Paste"), create),
                            (ru('Paste Settings'), settings),
                            (ru('About'), about), (ru("Exit"), exit)]
コード例 #21
0
 def text_control(self):
     appuifw.app.body = text_obj = appuifw.Text()
     text_obj.add(u"The Virtual Key Pad should not be visible in this mode")
コード例 #22
0
 def __init__(self, SMS_multiviewApp):
     self.SMS_multiviewApp = SMS_multiviewApp
     self.view_text = appuifw.Text()
コード例 #23
0
 def __init__(self, SMS_multiviewApp):
     self.SMS_multiviewApp = SMS_multiviewApp
     self.log_text = appuifw.Text()
     self.log_contents = u""
コード例 #24
0
ファイル: app_body_text.py プロジェクト: Symbian9/EPROM
import appuifw
import e32


def exit_key_handler():
    app_lock.signal()


# create an instance of appuifw.Text()
round = appuifw.Text()
# change the style of the text
round.style = appuifw.STYLE_UNDERLINE
# set the text to 'hello'
round.set(u'hello')

# put the screen size to full screen
appuifw.app.screen = 'full'

# create an Active Object
app_lock = e32.Ao_lock()

# set the application body to Text
# by handing over "round" which is an instance of appuifw.Text() as definded above
appuifw.app.body = round

appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
コード例 #25
0
def exit():
    if appuifw.query(cn("要退出吗?"), "query"):  #按“是”时执行下个语句
        appuifw.app.set_exit()


def read():  #定义读取函数
    try:  #尝试,若无此语句,不存在“e:\\tengge.txt”时会出错!
        file = open("e:\\tengge.txt", "r")  #"r"只读,"w"可写,"a"添加
        text = file.read().decode("utf8")  #读取,并将储存的数据按"utf8"格式译码为unicode
        t.set(text)
        file.close()  #最后一定要关闭该文件供系统使用
        appuifw.note(cn("读取成功!"), "conf")
    except:  #如果上面语句无法执行,就执行下面的
        appuifw.note(cn("读取失败!"), "error")


def save():  #定义保存函数
    try:
        file = open("e:\\tengge.txt", "w")
        text = t.get().encode("utf8")  #获取屏幕内容以“utf8”的方式编码并储存
        file.write(text)  #向文件中写数据,对应read
        file.close()
        appuifw.note(cn("保存成功!"), "conf")
    except:
        appuifw.note(cn("保存失败!"), "error")


appuifw.app.body = t = appuifw.Text()
appuifw.app.title = cn("记事本")
appuifw.app.menu = [(cn("保存"), save), (cn("读取"), read), (cn("退出"), exit)]
e32.Ao_lock().wait()
コード例 #26
0
ファイル: 字体操作.py プロジェクト: Symbian9/pycoder
import appuifw,e32
def cn(x):return x.decode("utf8")
appuifw.app.body= m =appuifw.Text()
m.color=(255,0,0)#红色,第一种表示方法
m.add(cn("我爱Python!\n"))
m.color=0x0000ff#蓝色,第二种表示方法
m.add(cn("教程是tengge写的。\n"))
m.style=appuifw.HIGHLIGHT_ROUNDED
m.add(cn("这是高亮圆体!\n"))
m.style=appuifw.HIGHLIGHT_SHADOW
m.add(cn("这是高亮阴影!\n"))
m.style=appuifw.HIGHLIGHT_STANDARD
m.add(cn("这是高亮标准!\n"))
m.style=appuifw.STYLE_BOLD
m.add(cn("这是粗体!\n"))
m.style=appuifw.STYLE_ITALIC
m.add(cn("这是斜体!\n"))
m.style=appuifw.STYLE_STRIKETHROUGH
m.add(cn("这是删除线!\n"))
m.style=appuifw.STYLE_UNDERLINE
m.add(cn("这是下划线!\n"))

e32.Ao_lock().wait()

コード例 #27
0
# Copyright (c) 2006 Jurgen Scheible
# This script creates tabs that let you switch between different applications

import appuifw
import e32
from graphics import *


def callback():
    print 'foo callback'


# define application 1: text app
app1 = appuifw.Text(u'Appliation o-n-e is on')

# define application 2: text app
app2 = appuifw.Text(u'Appliation t-w-o is on')

# define application 3: text app
app3 = appuifw.Listbox([(u'Sum', u'22'), (u'ones', u'12'), (u'twos', u'2')],
                       callback)


def exit_key_handler():
    app_lock.signal()


# create a tab handler that switches the application based on what tab is selected
def handle_tab(index):
    global lb
    if index == 0:
コード例 #28
0
ファイル: default.py プロジェクト: apanly/sypFTP
    def __init__(self):
        """ Get info about drives in Symbian OS """
        self.appDrive()
        self.generateDriveList()
        """ Set app info """
        self.__NAME__ = u"sypFTP"
        self.__VERSION__ = u"0.1.0"
        self.__AUTHOR__ = u"Intars Students"
        self.__EMAIL__ = u"*****@*****.**"
        self.__URL__ = u"http://code.google.com/p/sypftp/"
        self.__UPDATE__ = u"http://sypftp.googlecode.com/svn/trunk/VERSION"

        self.log_arr = []
        self.ftpd_running = False
        self.ftpd_auto = True
        self.db = u"%s\\options.db" % self.__APPDIR__
        """ Set default user options and load custom ones (if there is some) """
        self.default = {
            u"port": 21,
            u"user": u"user",
            u"pass": u"12345",
            u"dir": u"C:\\"
        }

        self.getOptions()
        """ Hook FTP server log's to main console output """
        ftpserver.log = self.log
        ftpserver.logline = self.log
        ftpserver.logerror = self.log
        """ Set look and feel of main console """
        self.uiConsole = appuifw.Text()
        self.uiPopup = globalui

        appuifw.app.title = self.__NAME__
        self.uiMenu(["connect", "options", "about", "exit"])
        appuifw.app.body = self.uiConsole
        appuifw.app.screen = "normal"
        appuifw.app.exit_key_handler = self.exit
        """ Set look and feel of options """
        self.uiOptions = appuifw.Form(
            [(u"Port", "number", self.default["port"]),
             (u"User", "text", self.default["user"]),
             (u"Paswd", "text", self.default["pass"]),
             (u"Dir.", "combo",
              (self.available_drives,
               self.available_drives.index(self.default["dir"])))],
            appuifw.FFormEditModeOnly)
        self.uiOptions.save_hook = self.saveOptions
        """ Start console output thread """
        self.console_thread = e32.Ao_timer()
        self.console_thread.after(0, self.console)
        """ Start up network (if it possible) """
        self.networking()
        """ If there is network connection, start ftp server """
        if self.getIP() != False:
            self.ftp_server_start()
        """ Start network check thread """
        self.network_thread = e32.Ao_timer()
        self.network_thread.after(10, self.network_deamon)
        """ Update thread """
        self.update_thread = e32.Ao_timer()
        """ Lock and load """
        self.app_lock = e32.Ao_lock()
        self.app_lock.wait()
コード例 #29
0
ファイル: default.py プロジェクト: Symbian9/pycoder
def txt():
    global m
    try:
        appuifw.app.body = m = appuifw.Text(m.get())
    except:
        appuifw.app.body = m = appuifw.Text()

    appuifw.app.screen = 'normal'

    m.bind(63557, lambda: m.add(u'[br]'))

    def exit2():
        if appuifw.query(cn('是否保存编贴内容??'), 'query'):
            text = m.get().encode('utf-8')
            f = open('E:\\system\\apps\\biaxi\\zntx.txt', 'w')
            f.write(text)
            f.close()
            appuifw.note(cn('保存成功!!\n感谢使用捞坚作品!!'), 'conf')
            alist()
        else:
            alist()
#exit保存

    def load():
        try:
            z = open('E:\\system\\apps\\biaxi\\zntx.txt', 'r')
            content = z.read().decode('utf-8')
            z.close()
            m.add(content)
        except:
            appuifw.note(cn('找不到以存贴子!!\n请确定作品安装在E盘!!'), 'error')

    def save():
        if appuifw.query(cn('是否储存当前内容??'), 'query'):
            text = m.get().encode('utf-8')
            s = open('E:\\system\\apps\\biaxi\\zntx.txt', 'w')
            s.write(text)
            s.close()
            appuifw.note(cn('保存成功!!\n感谢使用捞坚作品!!'), 'conf')
#菜单存读

    def yy():
        appuifw.app.body = mm = appuifw.Text()
        mm.color = 0x0000ff
        appuifw.app.screen = 'full'
        mm.set(m.get().replace('[br]', '\n').replace(
            '[hello]', cn('<问候语>')).replace('[weekday]', cn('<系统星期>')).replace(
                '[now]', cn('<系统时间>')).replace('[ttcc]', cn('<农历时间>')).replace(
                    '[nickname]', cn('<显示昵称>')))
        appuifw.app.menu = [(cn('返回'), txt)]
        appuifw.app.exit_key_handler = txt


#预览

    def coin():
        money = appuifw.query(cn('请输入金钱数:'), 'number')
        m.add(u'[coin=' + str(money) + cn(']内容[/coin]'))

    def grade():
        lv = appuifw.query(cn('请输入等级数:'), 'number')
        m.add(u'[grade=' + str(lv) + cn(']内容[/grade]'))

    def buy():
        gq = appuifw.query(cn('请输入金钱数:'), 'number')
        m.add(u'[buy=' + str(gq) + cn(']内容[/buy]'))


    appuifw.app.menu = [\
(cn('*ubb*代码'),\
(\
(cn('加粗字体'),lambda:m.add(cn('[b]内容[/b]'))),\
(cn('下划线'),lambda:m.add(cn('[u]内容[/u]'))),\
(cn('斜体'),lambda:m.add(cn('[i]内容[/i]'))),\
(cn('换行'),lambda:m.add(cn('[br]'))),\
(cn('分切页面'),lambda:m.add(cn('[next]'))),\
(cn('网页连接'),lambda:m.add(cn('[url=网页地址]显示内容[/url]'))),\
(cn('网络图片'),lambda:m.add(cn('[img]图片地址[/img]'))),\
(cn('问候语'),lambda:m.add(u'[hello]')),\
(cn('显示昵称'),lambda:m.add(u'[nickname]')),\
(cn('显示农历'),lambda:m.add(u'[ttcc]')),\
(cn('系统时间'),lambda:m.add(u'[now]')),\
(cn('系统星期'),lambda:m.add(u'[weekday]'))\
)),\
\
\
(cn('*可见贴*'),\
(\
(cn('登陆可见'),lambda:m.add(cn('[login]内容[/login]'))),\
(cn('手机可见'),lambda:m.add(cn('[mobi]内容[/mobi]'))),\
(cn('金钱可见'),coin),\
(cn('等级可见'),grade),\
(cn('付费可见'),buy)\
)),\
\
\
(cn('屏幕'),\
(\
(cn('清空屏幕'),lambda:m.set('')),\
(cn('隔离文字'),lambda:m.add(u'[br]\n[br]\n[br]')),\
(cn('预览贴子'),yy)\
)),\
\
\
(cn('模拟贴'),\
(\
(cn('软件发布'),mko),\
(cn('主题发布'),mkt)\
)),\
\
(cn('保存与读取'),\
(\
(cn('保存'),save),\
(cn('读取'),load)\
)),\
\
(cn('打开UcWeb60'),uc),\
]

    appuifw.app.exit_key_handler = exit2
コード例 #30
0
import e32
import e32db
import socket
import time
import string

import orm
import keyboard
import butterflydb
import capture
import trap
import site_ima
import xy_position
import attachment

t = appuifw.Text()
appuifw.body = t
t.clear()
t.add(u'Loading...')

# Create the application objects 
class ButterflyApp:
    def __init__(self):
        # Database stuff start
        trapsconfigdb = u'e:\\trapsconfig.db'
        testdb = u'e:\\test.db'
        self.db = e32db.Dbms()
        try:
            self.db.open(testdb)
        except:
            self.db.create(testdb)