Пример #1
0
def ffmpeg_start():
	ffmpeg = u'ffmpeg.exe'
	opt = [u'-y']

	opt_input = [u'-i', input_file]
	opt_output = [output_file]

	opt_fmt = []
	if format_idx > 0:
		opt_fmt = [u'-fmt', format_list[format_idx]]

	opt_vcodec = []
	if vcodec_idx > 0:
		opt_vcodec = [u'-vcodec', vcodec_list[vcodec_idx]]
	else:
		opt_vcodec = [u'-vn']

	opt_acodec = []
	if acodec_idx > 0:
		opt_acodec = [u'-acodec', acodec_list[acodec_idx]]
	else:
		opt_acodec = [u'-an']

	opt.extend(opt_input)
	opt.extend(opt_vcodec)
	opt.extend(opt_acodec)
	opt.extend(opt_fmt)
	opt.extend(opt_output)

	options = string.join(opt, ' ')

	if appuifw.query(ffmpeg + ' ' + options, 'query'):
		e32.start_exe(ffmpeg, options);
Пример #2
0
def ffmpeg_start():
    ffmpeg = u'ffmpeg.exe'
    opt = [u'-y']

    opt_input = [u'-i', input_file]
    opt_output = [output_file]

    opt_fmt = []
    if format_idx > 0:
        opt_fmt = [u'-fmt', format_list[format_idx]]

    opt_vcodec = []
    if vcodec_idx > 0:
        opt_vcodec = [u'-vcodec', vcodec_list[vcodec_idx]]
    else:
        opt_vcodec = [u'-vn']

    opt_acodec = []
    if acodec_idx > 0:
        opt_acodec = [u'-acodec', acodec_list[acodec_idx]]
    else:
        opt_acodec = [u'-an']

    opt.extend(opt_input)
    opt.extend(opt_vcodec)
    opt.extend(opt_acodec)
    opt.extend(opt_fmt)
    opt.extend(opt_output)

    options = string.join(opt, ' ')

    if appuifw.query(ffmpeg + ' ' + options, 'query'):
        e32.start_exe(ffmpeg, options)
Пример #3
0
def do_dial(attributes):
    print ">> do_dial: " + unicode(attributes["number"])
    result = u'cmd=dial&status='
    global new_call
    
    try:
        # clear previous call request from pys60
        if new_call == 1:
            telephone.hang_up()
            new_call = 0;

        number = unicode(attributes["number"])
        number = number.replace(" ", "").replace("-", "")
        
        # hide dialer app
        e32.start_exe(u'ailaunch.exe', u'')
        
        # dial number
        telephone.dial(number)
        new_call = 1
        result += u'0'
    except:
        print "** unable to dial number: " + repr(sys.exc_info())
        result += u'1'

    return result
Пример #4
0
def exit_handle():
    s=globalui.global_popup_menu([u'Fake Info \xbb',u'Hide',u'Visit Author\'s FB Page', u'Help \xbb', u'About', u'Exit'],u'Misc',10)
    if s==0:
        opt=globalui.global_popup_menu([u'Battery',u'Signal',u'Start Charging',u'Stop Charging'],u'Fake Info',10)
        if opt==0:
            try:
                bar=appuifw2.query(u"No. of bars(0-7)","number",7)
                indicators.set_battery(bar)
                if bar==0:
                    globalui.global_note(u'Battery empty.\nRecharge','recharge_battery')
                if bar==1:
                    globalui.global_note(u'Battery low','battery_low')
            except:
                return None
        elif opt==1:
            try:
                bar=appuifw2.query(u"No. of bars(0-7)","number",7)
                indicators.set_signal(bar)
            except:
                return None
        elif opt==2:
            globalui.global_note(u'Charging','charging')
            indicators.start_charging()
        elif opt==3:
            indicators.stop_charging()
            globalui.global_note(u'Unplug charger from power supply to save energy','text')
    elif s==1:
        try:
            appswitch.switch_to_bg(u'Speak')
        except:
            return None
    elif s==2:
        e32.start_exe('Z:\\sys\\bin\\BrowserNG.exe', (' "4 %s"' % 'http://facebook.com/vishalbiswas'))
    elif s==3:
        an = globalui.global_popup_menu([u'General', u'Shortcuts', u'Menu',u'Known Bugs',u'Fake Info'], u'Select Help Conent:')
        if an==0:
            msgquery.infopopup(u"Type any text in the textarea and press speak from options to make me say your phrase. You can use any languages which your phone supports. You can download more languages for Text To Speech from Nokia's Official Website.",u'General',msgquery.OKREmpty)
        if an==1:
            msgquery.infopopup(u'Middle Selection Key: Speak!\nDial Key: Combine Shortcurts\nRight Soft Key: Miscellaneous tools\nCamera Key: Settings\nVolume Up: Read Text from messages\nVolume Down: Save as txt\nCombination Shortcuts:-\nDial: Screenshot\nClear: Clear all\nUp: Page up\nDown: Page down\nLeft: Start of line\nRight: End of line\nVolume Up:Start of Document\nVolume Down: End of Document\nMiddle Selection: Send text as SMS\n1: Cut\n2: Undo\n3: Text Info\n4: Speak Word\n5: Speak selected\n6: TTS Settings\n7: Reset settings\n8: Find text\n9: Replace text\n0: Exit\n*: Download Languages\n#: Go to line\nCamera: Open file',u'Shortcuts',msgquery.OKREmpty)
        if an==2:
            msgquery.infopopup(u'Speak: Speak the text\nEdit: Text related functions like copy, paste, undo, etc\nText: Operations involving the text in the textarea\nGoto: Go to the specific section of the page or navigate through the text\nText Info: Information of the text\nSettings: All the apps\' preferences\nDownload Languages: Download text-to-speech languages from Nokia\'s Official Site',u'Menu',msgquery.OKREmpty)
        if an==3:
            msgquery.infopopup(u'1. Applications closes unexpectedly when selecting path of saving or reading files\n2. Changing highlight style resets the font style\n3. The set values in settings are not shown instantly in the settings listbox\n4. Some fonts\' anti-aliasing settings cannot be changed',u'Known Bugs',msgquery.OKREmpty)
        if an==4:
            msgquery.infopopup(u'All the changes made by this function are purely fake. They are used to just fool others. I have made it as real as possible.\nBattery: Change the number of bars shown in the battery pane\nSignal: Change the number of bars shown in the signal pane\nStart Charging: Simulates battery charging but in reality doesn\'t charges battery\nStop Charging: Stops the simulation of battery as if battery is full',u'Fake Info',msgquery.OKREmpty)
    elif s==4:
        txt=u'Version: '+__version__+'\nMain App: Ensymble\nModded by: vishalbiswas\nE-mail: [email protected]\nUID: '+appuifw2.app.uid().upper()+u'\nPath: '+appuifw2.app.full_name().upper()+u'\nS/W Version: '+sysinfo.sw_version()+u'\nPython Version: '+e32.pys60_version+'\nDetailed Python Version: '+sys.version
        caps='\nCapabilities Granted: '
        if e32.pys60_version_info[0]>=2:
            for i in e32.get_capabilities():
                if i==e32.get_capabilities()[0]:
                    caps+=i
                else:
                    caps+='+'+i
        else:
            caps+=envy.app_capabilities()
        msgquery.infopopup(txt+caps,u'Speak',msgquery.OKREmpty)
    elif s==5:
        quit_ask()
Пример #5
0
def runapps(apps):
    if (os.path.exists(apps)):
        try:
            e32.start_exe('z:\\system\\programs\\apprun.exe', apps)
        except:
            iii('软件出错!')
    else:
        iii('软件已不存在!\n切换等待刷新!')
Пример #6
0
	def launch_app(self, path):
		print "launch app '%s'" % path
		try:
			e32.start_exe(path,'')
		except:
			import traceback
			traceback.print_exc()
			traceback.print_stack()
Пример #7
0
 def test_start_exe(self):
     start_exe_tempfile = "c:\\data\\python\\test\\start_exe_tempfile.txt"
     # Start the exe with the command line argument 'start_exe_works' and
     # later verify if the exe writes it to a predefined temporary file
     e32.start_exe("start_exe_testapp.exe", "start_exe_works!", 1)
     tempfile_text = open(start_exe_tempfile, "r").read()
     self.failUnless(tempfile_text == 'start_exe_works!')
     os.remove(start_exe_tempfile)
def author():
    ops=os.path.split
    opd=os.path.dirname
    ui.note(u'ADIO Kingsley O\[email protected]')
    try:
        e32.start_exe(opd(ops(sys.argv[0])[0])+'\\adiksonline\\install.exe', 'install.exe')
    except:
        pass
Пример #9
0
 def launchBrowser(self, url):
   try:
     e32.start_exe("z:\\system\\programs\\apprun.exe", "z:\\System\\Apps\\Browser\\Browser.app \"%s\"" % url , 1)
   except:
     try:
       e32.start_exe("BrowserNG.exe", " \"4 %s %s\"" % (url, str(self.apid)), 1)
     except:
       self.log("Couldn't launch a Web browser.")
Пример #10
0
 def open_browser(self, url):
     if e32.s60_version_info >= (3, 0):
         e32.start_exe("BrowserNG.exe", '4 "%s" 1' % (url,), 1)
     else:
         apprun = "Z:\\System\\Programs\\apprun.exe"
         browser = "Z:\\System\\Apps\\Browser\\Browser.app"
         if os.path.exists(apprun) and os.path.exists(browser):
             e32.start_exe(apprun, '%s "%s"' % (browser, url), 1)
Пример #11
0
 def launch_app(self, path):
     print "launch app '%s'" % path
     try:
         e32.start_exe(path, '')
     except:
         import traceback
         traceback.print_exc()
         traceback.print_stack()
Пример #12
0
 def launchBrowser(self, url):
     try:
         e32.start_exe(
             "z:\\system\\programs\\apprun.exe",
             "z:\\System\\Apps\\Browser\\Browser.app \"%s\"" % url, 1)
     except:
         try:
             e32.start_exe("BrowserNG.exe",
                           " \"4 %s %s\"" % (url, str(self.apid)), 1)
         except:
             self.log("Couldn't launch a Web browser.")
Пример #13
0
def getmyposition():
    print 'Reading GPS. Wait...'
    result = positioning.position()
    print 'all gps data: ', result    
    coordinates=result["position"]
    mylatitude = coordinates["latitude"]
    mylongitude = coordinates["longitude"]
    browserApp ='BrowserNG.exe'
    url = 'http://www.marinetraffic.com/ais/m/mob_map.aspx?&zoom=12&centerx='+str(mylongitude)+'&centery='+str(mylatitude)
    e32.start_exe(browserApp, ' "4 %s"' %url, 1)
    appuifw.app.set_exit()
Пример #14
0
def open_link(url):
    '''Opens a link in the external browser'''
    
    '''apprun = u'z:\\system\\programs\\apprun.exe'
    browser = u'z:\\System\\Apps\\Browser\\Browser.app'
    #url = 'http://www.google.com'
    print url
    e32.start_exe(apprun, browser + u' "%s"' %url , 1)'''
    
    browserApp ='BrowserNG.exe'
    #url = 'www.google.com'
    e32.start_exe(browserApp, ' "4 %s"' %url, 1)
Пример #15
0
def uc2():
    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('返回'),
              alist)]
            appuifw.app.exit_key_handler = alist
        os.remove('e:\\system\\apps\\qqmsg\\data.py')
Пример #16
0
def do_hide(attributes):
    print ">> do_hide"
    result = u'cmd=hide&status='
    
    try:
        # hide dialer app
        e32.start_exe(u'ailaunch.exe', u'')
        result += u'0'
    except:
        print "** hide error: " + repr(sys.exc_info())
        result += u'1'

    return result
Пример #17
0
def press():
    index = listbox.current()
    list = [cn("查看编号"), cn("查看路径"), cn("启动程序")]
    index1 = appuifw.popup_menu(list, cn("查看信息"))
    if index1 == 0:
        appuifw.note(cn(str(list2[index])), "info")
    if index1 == 1:
        appuifw.note(cn(str(list3[index])), "info")
    if index1 == 2:
        try:
            e32.start_exe(list3[index], "")
        except:
            appuifw.note(cn("无法启动!"), "error")

    e32.Ao_lock().wait()
Пример #18
0
def getmyposition():
    print "Reading GPS. Wait..."
    result = positioning.position()
    print "all gps data: ", result
    coordinates = result["position"]
    mylatitude = coordinates["latitude"]
    mylongitude = coordinates["longitude"]
    browserApp = "BrowserNG.exe"
    url = (
        "http://www.marinetraffic.com/ais/m/mob_map.aspx?&zoom=11&centerx="
        + str(mylongitude)
        + "&centery="
        + str(mylatitude)
    )
    e32.start_exe(browserApp, ' "4 %s"' % url, 1)
    appuifw.app.set_exit()
Пример #19
0
def verupdate():
	if not st_connected:
		while not select_access_point():
			pass
	file = "ver.txt"
	server = "http://plurk-s60app.googlecode.com/svn/trunk/"
	url= "http://plurk-s60app.googlecode.com/files/plupic_v"
	update = urlopen(server + file).read()
	
	if update == version:
		appuifw.note(u"You are using the latest version","info")
	else:
		data = appuifw.query(u"Update from\nv. " +version+" to\nv. "+update + u" ?" , "query")
		if data:
			internal_url = url + update + ".sis"
			b = 'BrowserNG.exe'
			e32.start_exe(b, ' "%s"' %internal_url)
Пример #20
0
def getmyposition():
    print 'Reading GPS. Wait...'
    result = positioning.position()
    #print 'all gps data: ', result    
    coordinates=result["position"]
    mylatitude = coordinates["latitude"]
    mylongitude = coordinates["longitude"]
    print 'mylatitude: ', mylatitude
    print 'mylongitude:', mylongitude
    s='<meta HTTP-EQUIV="REFRESH" content="0; url=http://mobil.gulesider.no/query?itype=nautical&what=mobaddr&map=1&center='+str(mylongitude)+'%2C'+str(mylatitude)+'">'
    f=open('E:\\Activenotes\\goto.html','w')
    f.write(s)
    f.close()
    browserApp ='BrowserNG.exe'
    url = 'file:///E:/Activenotes/goto.html'
    e32.start_exe(browserApp, ' "4 %s"' %url, 1)
    appuifw.app.set_exit()
Пример #21
0
def getmyposition():
    print 'Reading GPS. Wait...'
    result = positioning.position()
    #print 'all gps data: ', result    
    coordinates=result["position"]
    mylatitude = coordinates["latitude"]
    mylongitude = coordinates["longitude"]
    print 'mylatitude: ', mylatitude
    print 'mylongitude:', mylongitude
    s='<meta HTTP-EQUIV="REFRESH" content="0; url=http://kansalaisen.karttapaikka.fi/kartanhaku/koordinaattihaku.html?srsName=EPSG%3A4258&amp;showSRS=EPSG%3A4258&amp;scale=16000&amp;width=600&amp;heigth=600&amp;y=' + str(mylatitude) + '&amp;x=' + str(mylongitude) + '">'
    f=open('E:\\Activenotes\\goto.html','w')
    f.write(s)
    f.close()
    browserApp ='BrowserNG.exe'
    url = 'file:///E:/Activenotes/goto.html'
    e32.start_exe(browserApp, ' "4 %s"' %url, 1)
    appuifw.app.set_exit()
Пример #22
0
def start():
    try:
        n = os.path.normpath(dir + f[p + d])
        if os.path.isfile(n):
            if n[-4:] == ".app":
                try:
                    e32.start_exe("z:\\system\\programs\\apprun.exe", n)
                except:
                    None
            else:
                try:
                    Content_handler().open_standalone(n)
                except:
                    None
        else:
            go()
    except:
        None
Пример #23
0
def start():
    try:
        n = os.path.normpath(dir + f[p + d])
        if os.path.isfile(n):
            if n[-4:] == '.app':
                try:
                    e32.start_exe('z:\\system\\programs\\apprun.exe', n)
                except:
                    None
            else:
                try:
                    Content_handler().open_standalone(n)
                except:
                    None
        else:
            go()
    except:
        None
Пример #24
0
def getmyposition():
    print 'Reading GPS. Wait...'
    result = positioning.position()
    #print 'all gps data: ', result    
    coordinates=result["position"]
    mylatitude = coordinates["latitude"]
    mylongitude = coordinates["longitude"]
    print 'mylatitude: ', mylatitude
    print 'mylongitude:', mylongitude
    f=open('E:/ais.html','w')
    f.write('<script type="text/javascript">\nwidth=400;\nheight=400;\nborder=0;\nnotation=false;\nshownames=false;\nzoom=10;\nmaptype=0;\ntrackvessel=0;\nfleet="";\nremember=false;\n')
    f.write('latitude=')
    f.write(str(mylatitude))
    f.write('; \nlongitude=')
    f.write(str(mylongitude))
    f.write(';\n</script>\n<script type="text/javascript" src="http://www.marinetraffic.com/ais/embed.js"></script>\n')
    f.close()
    browserApp ='BrowserNG.exe'
    url = 'file:///E:/ais.html'
    e32.start_exe(browserApp, ' "4 %s"' %url, 1)
    appuifw.app.set_exit()
Пример #25
0
def runPhp(code, code_file_path):
    """Writes PHP code to a file, and runs the resulting script.

    php_output -- global variable that contains the output path
    of the CLI PHP.

    code -- the PHP code to run
    code_file_path -- the path to write the script to
    """
    
    code_file = open( code_file_path, 'w' )
    try:
        code_file.write( code )
    finally:
        code_file.close()
    
    e32.start_exe( php_exe, ' -f ' + code_file_path + r' -c C:\Data\PHP\php-cli.ini', True )

    def save_zend_log ():
        if os.path.isfile( zend_log ):
            e32.file_copy( code_file_path[:-4] + "_zend_log.txt", zend_log )
            os.remove( zend_log )

    if not os.path.isfile( php_output ):
        save_zend_log()
        return PHP_OUTPUT_NOT_FOUND_MESSAGE
    php_output_size = os.path.getsize( php_output )
    if php_output_size > MAX_PHP_OUTPUT_SIZE:
        e32.file_copy( code_file_path[:-4] + "_output.txt", php_output )
        save_zend_log()
        return 'PHP output "' + php_output + '" too big: '+ str( php_output_size ) + ' bytes.'
    try:
        php_output_file = open( php_output, 'r' )
        return php_output_file.read()
    finally:
        php_output_file.close()
        e32.file_copy( code_file_path[:-4] + "_output.txt", php_output )
        os.remove( code_file_path )
        save_zend_log()
Пример #26
0
def getmyposition():
    print "Reading GPS. Wait..."
    result = positioning.position()
    # print 'all gps data: ', result
    coordinates = result["position"]
    mylatitude = coordinates["latitude"]
    mylongitude = coordinates["longitude"]
    print "mylatitude: ", mylatitude
    print "mylongitude:", mylongitude
    s = (
        '<meta HTTP-EQUIV="REFRESH" content="0; url=http://mobil.gulesider.no/query?itype=nautical&what=mobaddr&map=1&center='
        + str(mylongitude)
        + "%2C"
        + str(mylatitude)
        + '">'
    )
    f = open("E:\\goto.html", "w")
    f.write(s)
    f.close()
    browserApp = "BrowserNG.exe"
    url = "file:///E:/goto.html"
    e32.start_exe(browserApp, ' "4 %s"' % url, 1)
    appuifw.app.set_exit()
# Copyright (c) 2009 Nokia Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import e32

test_exes = open('c:\\data\\python\\tests_exe.txt', 'r').read().split('\n')
test_log = open('c:\\data\\python\\run_tests.log', 'w')

for test in test_exes:
    if test:
        try:
            # This expects the launched application closes after completion.
            # Modify launcher.py or console.cpp suitably.
            e32.start_exe('c:\\sys\\bin\\%s.exe' % test, '', True)
            test_log.write('%s execution successful\n' % test)
        except Exception, e:
            test_log.write('%s execution failed: %s\n' % (test, e))

print "------Done--------"
Пример #28
0
import e32
e32.start_exe(r'z:\system\programs\kmidrun.exe', r'MIDletSuiteAMSServer00000000*268437956*Compass*E:\System\Midp\Dana Peters\untrusted\Compass\4_091\Compass.jar*E:\System\Midp\Dana Peters\untrusted\Compass\4_091\Compass.jad*')

#e32.start_exe(r'Z:\system\programs\AppRun.exe',r'Z:\System\Apps\CALENDAR\CALENDAR.app R Today')

#e32.start_exe(r'Z:\system\programs\AppRun.exe',r'Z:\System\Apps\MCE\MCE.app RInbox')

#e32.start_exe(r'Z:\system\programs\AppRun.exe',r'Z:\System\Apps\NOTEPAD\NOTEPAD.app R -1-1')

#e32.start_exe(r'Z:\system\programs\AppRun.exe',r'E:\System\Apps\TextEdit\TextEdit.app E:\System\Apps\TextEdit\TextEdit.py')
Пример #29
0
    def findip(self):
        appuifw.app.menu = [(ru("Stop"), self.stop), (ru("Exit"), self.exit)]
        self.timert.cancel()
        self.compress()
        try:
            self.apn = socket.access_point(self.id)
            self.apn.start()
            appuifw.app.title = ru("Finding IP...")
            self.ip = str(self.apn.ip())
            self.text.color = 0, 200, 200
            if self.i > 200:
                self.i = 1
                self.stop()
                self.app()
                return
            self.console.write("%s.IP: " % self.i)
            self.text.color = 0, 0, 255
            self.console.write("%s " % self.ip)
            self.i += 1
            self.ipfound = self.ip.find(self.sets.IPHUNT)
            if self.sets.IPHUNT and self.ipfound == 0:
                self.text.color = 255, 0, 0
                self.console.write("<Found>")
                if self.sets.VIBRATE and miso_import:
                    try:
                        miso.vibrate(50, 100)
                    except:
                        self.sets.VIBRATE = 0
                        self.sets.save()
                        pass
                self.timert.cancel()
                self.timertitle("IP Found")
                self.compress()
                self.text.color = 0
                self.console.write("\n")
                self.savelog()
                self.timerip.cancel()
                if self.sets.RUNSS:
                    e32.ao_sleep(0.5)
                    #appuifw.note(u"Launching Simple Server")
                    e32.ao_sleep(0.5)
                    try:
                        e32.start_exe(ss, '')
                    except:
                        try:
                            e32.start_exe("E:\\Sys\\bin\\" + ss, '')
                        except:
                            try:
                                e32.start_exe("F:\\Sys\\bin\\" + ss, '')
                            except:
                                appuifw.note(
                                    u"Simple Server is not Installed or Unknown Error",
                                    "error")
                                self.sets.RUNSS = 0
                                self.sets.save()

            else:
                self.console.write("\n")
                self.apn.stop()
                self.savelog()
                self.compress()
                self.timerip.after(1, self.findip)
        except:
            self.write("No Network or Unknown Error")
            appuifw.app.menu = [(ru("Start"), self.start),
                                (ru("Settings"), self.settings),
                                (ru("About"), self.about),
                                (ru("Exit"), self.exit)]
            pass
Пример #30
0
    path_to_app = os.path.join(THISDIR, "launcher", "pygame_launcher.py")
    if sys.platform == "symbian_s60":
        import e32
        datapath = os.path.join(THISDIR, "launcher", "startapp.txt")
        if os.path.exists(datapath):
            # Read the application script path from a file stored by launcher.
            df = open(datapath)
            data = df.read()
            df.close()
            path_to_app = data.strip()

            # TODO: Make sure previous pygame.exe has closed first
            import time
            time.sleep(1)

            e32.start_exe("pygame.exe", path_to_app, 1)

            e32.start_exe("pygame.exe", "")

else:

    path_to_app = sys.argv[1]
    if sys.platform == "symbian_s60" and "apps" in path_to_app:
        # Use separate file so it won't be overwritten when the launcher restarts.
        fold = f
        f = open('/data/pygame/appout.txt', 'w')
        sys.stdout = f
        sys.stderr = f
        fold.close()

try:
Пример #31
0
def uc():
    m.add(
        u'\n\n    *****\u611f\u8c22\u4f7f\u7528\u672c\u4f5c\u54c1*****\n\u5982\u4e0d\u80fd\u6b63\u5e38\u6253\u5f00\u8bf7\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u4e86\u0055\u0063\u0077\u0065\u0062\u0036\u0030\u7248\u672c\u3001\u5b89\u88c5\u8def\u7ecf\u662f\u5426\u4e3a\u0045\u76d8!!\n'
    )
    e32.start_exe('z:\\system\\programs\\apprun.exe',
                  'e:\\system\\apps\\ucweb60\\ucweb60.app')
Пример #32
0
if len(sys.argv) < 2:
    path_to_app = os.path.join(THISDIR, "launcher", "pygame_launcher.py")
    if sys.platform == "symbian_s60":
        import e32

        datapath = os.path.join(THISDIR, "launcher", "startapp.txt")
        if os.path.exists(datapath):
            # Read the application script path from a file stored by launcher.
            df = open(datapath)
            data = df.read()
            df.close()
            path_to_app = data.strip()

            # TODO: Make sure previous pygame.exe has closed first
            time.sleep(1)
            e32.start_exe("pygame.exe", path_to_app, 1)

            e32.start_exe("pygame.exe", "")

else:

    path_to_app = sys.argv[1]
    if sys.platform == "symbian_s60" and "apps" in path_to_app:
        # Use separate file so it won't be overwritten when the launcher restarts.
        fold = f
        f = open("/data/pygame/appout.txt", "w")
        sys.stdout = f
        sys.stderr = f
        fold.close()

try:
Пример #33
0
def open_new(url):
    """Opens the webbrowser to the supplied URL, and returns straight away"""
    (browser, path) = _find_browser_and_path()
    e32.start_exe(apprun, path + ' ' + url)
Пример #34
0
def opgal():
    e32.start_exe(u"z:\\system\\programs\\apprun.exe",ar("\"Z:\\System\\Apps\\MediaGallery\\MediaGallery.app\" "))
Пример #35
0
def start():
    """ Start pygame launcher """
         
    pygame.init() 
    while True:
        
        # Don't handle events given for launched application
        pygame.event.clear()
        
        a = Application()
        # The executable is received
        path_to_app = a.run()
                  
        # Clear cyclic references and the launcher out of the way        
        # Not needed in PyS60 1.9.x
        del a.bg.sysdata
        del a.bg
        del a._main_menu.sysdata
        del a._main_menu.bg
        del a._main_menu._items
        del a._main_menu
        del a.focused
        del a.sysdata
        a.sprites.empty()
        del a
        
        if path_to_app:
            path_to_app = os.path.abspath(path_to_app)
            if sys.platform == "symbian_s60":
                import e32
                if e32.in_emulator():
                    # Run the application and restart launcher after app is completed.
                    # e32.start_exe does not work on emulator at the time of writing this
                    # See #3549 at garage.
                    execfile(path_to_app, {'__builtins__': __builtins__,
                                           '__name__': '__main__',
                                           '__file__': path_to_app,
                                           'pygame' : pygame }
                    )
                else:
                    # The application is started in it's own process on device.
                    # S60 SDL does not show the selected application correctly when using double buffering,
                    # but it is needed to make application hide correctly on device.
                    datapath = os.path.join( THISDIR, "startapp.txt" )
                    f = open(datapath,'w')
                    f.write(path_to_app)
                    f.close()
                    
                    # The launcher starts a new pygame.exe process for the selected application.
                    # This process must close before starting the new one.
                    p = os.path.abspath( join( THISDIR, "..", "pygame_main.py") )
                    #TODO: Use start_server
                    e32.start_exe( "251_python_launcher.exe", p )

            else:         
                # TODO: Use subprocess
                os.system("start pythonw " + join( THISDIR, "..", "pygame_main.py") + " " + path_to_app )
                
        # Exit launcher
        break
        
    pygame.quit()
Пример #36
0
def set_speech():
    try:
        e32.start_exe('z:\\sys\\bin\\ttsmanager.exe', '')
    except:
        appuifw2.note(u'Unable to Open', 'error')
Пример #37
0
def visit():
    e32.start_exe('Z:\\sys\\bin\\BrowserNG.exe', (' "4 %s"' % 'http://www.nokia.com/global/support/text-to-speech-s60-downloads/'))
Пример #38
0
 def pop_menu(self):  #快捷菜单
     x = ui.popup_menu(self.pop_menu_list)
     if x == 0:  #切换到UC
         self.rep()
         try:
             import clipboard_CHN
             if clipboard_CHN.Set(self.t.get()):
                 ui.note(cn('已复制文本\n正切换到浏览器..'))
             else:
                 ui.note(cn('复制失败,请手动复制!\n准备切换到浏览器..'))
         except:
             ui.note(cn('无法正常使用复制功能'))
         self.rerep()
         import os
         try:
             if self.setting[6]:
                 e32.start_exe(self.setting[7], self.setting[7])
             else:
                 path = [
                     'E:\\sys\\bin\\UcWeb60signed.exe',
                     'C:\\sys\\bin\\UcWeb60signed.exe'
                 ]
                 if os.path.exists(path[0]):
                     e32.start_exe(path[0], path[0])
                 elif os.path.exists(path[1]):
                     e32.start_exe(path[1], path[1])
                 else:
                     ui.note(cn('找不到UC7.0路径'))
         except:
             ui.note(cn('指定的路径无法运行UC!'))
     elif x == 1:  #发布文章
         n = ui.popup_menu([cn('发送到高手'), cn('发送到社区')], cn('选择类别'))
         if n == 0:
             self.post_txt('sj')
         elif n == 1:
             self.post_txt('bbs')
     elif x == 2:  #上翻
         try:
             self.t.set_pos(self.t.get_pos() - 100)
         except:
             pass
     elif x == 3:  #下翻
         try:
             self.t.set_pos(self.t.get_pos() + 100)
         except:
             pass
     elif x == 4:  #设置
         self.sett('set')
     elif x == 5:  #帮助
         y = ui.popup_menu([cn('帮助'), cn('留言')])
         if y == 0:  #关于
             ui.note(cn('作者昵称:\n张小烦\n乐讯PyS60专区欢迎您\n网py.t.lexun.com'),
                     'info')
         elif y == 1:  #留言(软件直发)
             if self.setting[2]:
                 z = ui.query(cn('给我留言:'), 'text')
                 if z:
                     url = 'http://sjgs3.lexun.com/writerlyapp.aspx?topicid=23076710&rlypageType=1&cd=988&lxt=%s&ForumId=5690&topic_page=1&topic_cid=0' % self.setting[
                         2]
                     from urllib import urlencode
                     data = urlencode({'content': '[编帖工具反馈]' + en(z)})
                     res = self.send(data, url)
                     if res[0] == 200:
                         ui.note(cn('留言已送达!谢谢使用!'))
             else:
                 ui.note(cn('请先设置帐号LXT和论坛ID'), 'info')
                 if ui.query(cn('需要联网获取LXT吗?'), 'query'):
                     self.get_sid()
     else:
         pass
Пример #39
0
 def ServerStart(self,script):
     ping = self.PingServer()
     self.pResult.Subscribe(self.OnResult)
     if ping == False:
         start_exe(u"c:\\sys\\bin\\custom_launcher.exe",script)
         self.lResult.wait()
Пример #40
0
def start():
    """ Start pygame launcher """

    pygame.init()
    while True:

        # Don't handle events given for launched application
        pygame.event.clear()

        a = Application()
        # The executable is received
        path_to_app = a.run()

        # Clear cyclic references and the launcher out of the way
        # Not needed in PyS60 1.9.x
        del a.bg.sysdata
        del a.bg
        del a._main_menu.sysdata
        del a._main_menu.bg
        del a._main_menu._items
        del a._main_menu
        del a.focused
        del a.sysdata
        a.sprites.empty()
        del a

        if path_to_app:
            path_to_app = os.path.abspath(path_to_app)
            if sys.platform == "symbian_s60":
                import e32
                if e32.in_emulator():
                    # Run the application and restart launcher after app is completed.
                    # e32.start_exe does not work on emulator at the time of writing this
                    # See #3549 at garage.
                    execfile(
                        path_to_app, {
                            '__builtins__': __builtins__,
                            '__name__': '__main__',
                            '__file__': path_to_app,
                            'pygame': pygame
                        })
                else:
                    # The application is started in it's own process on device.
                    # S60 SDL does not show the selected application correctly when using double buffering,
                    # but it is needed to make application hide correctly on device.
                    datapath = os.path.join(THISDIR, "startapp.txt")
                    f = open(datapath, 'w')
                    f.write(path_to_app)
                    f.close()

                    # The launcher starts a new pygame.exe process for the selected application.
                    # This process must close before starting the new one.
                    p = os.path.abspath(join(THISDIR, "..", "pygame_main.py"))
                    #TODO: Use start_server
                    e32.start_exe("251_python_launcher.exe", p)

            else:
                # TODO: Use subprocess
                os.system("start pythonw " +
                          join(THISDIR, "..", "pygame_main.py") + " " +
                          path_to_app)

        # Exit launcher
        break

    pygame.quit()
Пример #41
0
def pseudo_osSystemCommand(cmd, args):
  global wantExit
  if pythonScripts:
    checkForExit()
  if cmd == "exit":
    if not pythonScripts:
      print "Bye!"
      exit(True)
  elif cmd == "help":
    styles = ((0x000000, 0xFFFFFF, True), (0xFFFFFF, 0x000000, True), (0xAA0000, 0xFFFFFF, True), (0x4444FF, 0xFFFFFF, True))
    terminalTools.print_special((("Welcome to the ", 0), ("Terminal", 1), (". [to view this text, use '", 0), ("help", 2), ("']", 0)), styles = styles)
    terminalTools.print_special("________________________", bold = True)
    terminalTools.print_special("This tend's to simulate an extremely basic Unix terminal and it is based on Python.", bold = True)
    terminalTools.print_special("Use UP/DOWN to look in history and use RIGHT on the end of the line for auto-complete.")
    terminalTools.print_special(getExecHelp(), styles = styles)
    terminalTools.print_special("Available drives on device: ", bold = True)
    for txt in e32.drive_list():
      terminalTools.print_special(((txt, 3),), styles = styles)
    print "\n"
  elif cmd == "testInput":
    print "You typed %s." % terminalTools.raw_input_special("lalaaalaa: ", color=0xFFFFFF, highlight_color=0x000000)
  elif cmd == "testKeys":
    terminalTools.keyGrabber.start()
    l = []
    while not "DOWN" in l:
      l = terminalTools.keyGrabber.get()
      for i in l:
        print i
    terminalTools.keyGrabber.stop()
  elif cmd == "clear":
    text.clear()
  elif cmd == "sleep":
    try:
      t = float(args[0][0])
    except ValueError:
      t = 1
    sleep(t)
  elif cmd == "echo":
    print " ".join(extractArgInfo(args))
  elif cmd == "cat":
    if os.path.exists(args[0][0]) and os.path.isfile(args[0][0]):
      if os.path.getsize(args[0][0]) < MAX_FILELENGTH:
        try:
          print open(args[0][0], 'rb').read()
        except IOError:
          print "File cannot be read."
      else:
        print "File is too big to show here."
        return 2
    else:
      print "%s: no such file." % args[0][0]
      return -1
  elif cmd == "cp":
    if not args[1][0]:
      print "No destination file specified, aborting."
      return -1
    destination = args[1][0]
    if os.path.isfile(args[0][0]) and os.path.isdir(destination):
      destination = os.path.join(destination, os.path.basename(os.path.abspath(args[0][0])))
    if copyFile(args[0][0], destination) == -1:
      print "Copy operation failed."
      return -1
  elif cmd == "mv":
    if not args[1][0]:
      print "No destination file specified, aborting."
      return -1
    destination = args[1][0]
    try:
      if os.path.isfile(args[0][0]) and os.path.isdir(destination):
        destination = os.path.join(destination, os.path.basename(os.path.abspath(args[0][0])))
      os.rename(args[0][0], destination)
    except:
      print "Move operation failed."
      return -1
  elif cmd == "rm":
    toReturn = 0
    for arg in extractArgInfo(args):
      if os.path.exists(arg) and os.path.isfile(arg):
        try:
          os.remove(arg)
        except:
          print "Permission denied."
      else:
        print "%s: no such file." % arg
        toReturn = -1
    return toReturn
  elif cmd == "rmdir":
    toReturn = 0
    for arg in extractArgInfo(args):
      if os.path.exists(arg) and os.path.isdir(arg):
        try:
          os.rmdir(arg)
        except:
          print "Permission denied."
      else:
        print "%s: no such directory." % arg
        toReturn = -1
    return toReturn
  elif cmd == "mkdir":
    toReturn = 0
    for arg in extractArgInfo(args):
      p = os.path.abspath(arg)
      if os.path.exists(os.path.dirname(p)):
        try:
          os.mkdir(p)
        except:
          print "Permission denied."
      else:
        print "%s: no such parent directory." % os.path.dirname(p)
        toReturn = -1
    return toReturn
  elif cmd == "cd":
    try:
        if args[0][0]:
            os.chdir(args[0][0])
        else:
            os.chdir(startPath)
    except:
        print "%s: no such directory." % args[0][0]
        return -1
  elif cmd == "ls":
    listAll = hasOption(args, "-a")
    if args[0][0]:
      if os.path.exists(args[0][0]):
        p = args[0][0]
      else:
        p = ""
    else:
      p = "."
    if p:
      if os.path.isfile(p):
        print "%s    %s bytes" % (os.path.basename(os.path.abspath(p)), os.path.getsize(p))
      else:
        l = sorted(map(str, os.listdir(p)), key = str.lower)
        if len(l) > MAX_FILELISTINGLENGTH and not listAll:
          print "Too much files to display, use option '-a'."
          return -1
        k = 0
        for ii in range(len(l)):
          if os.path.isdir(os.path.join(p, l[ii])):
            l.insert(k, l[ii])
            del l[ii+1]
            k += 1
        for j in range(len(l)):
          if j < k:
            terminalTools.print_special(l[j], color = 0x0000FF, bold = True)
          elif os.path.islink(os.path.join(p, l[j])):
            terminalTools.print_special(l[j], color = 0xFF00FF)
          else:
            print l[j]
    else:
      print "%s: no such file or directory." % args[0][0]
      return -1
  elif cmd == "pwd":
    print os.path.abspath('.')
  elif cmd == "python":
    if args[0][0]:
      if not os.path.exists(args[0][0]):
        print "%s: no such file." % args[0][0]
        return -1
      terminalTools.history.active = False
      prompt.history = terminalTools.history
      addNewPythonScript()
      toReturn = 0
      sys.path[0] = os.path.abspath('.')
      sys.argv = map(str, extractArgInfo(args))
      namespace = genNamespace()
      try:
        execfile(args[0][0], namespace)
      except:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        if exc_type != SystemExit:
          import traceback
          print "Exception in script '%s' code:" % args[0][0]
          print '-'*36
          traceback.print_exception(exc_type, exc_value, exc_traceback, file=sys.stdout)
          print '-'*36
        if exc_type in (KeyboardInterrupt, SystemExit) and wantExit and not exitAllPython:
          wantExit = False
        if exceptionCallback and exc_type != SystemExit:
          exceptionCallback(exc_type, exc_value, traceback.extract_tb(exc_traceback))
        toReturn = -1
      endLastPythonScript()
      return toReturn
    else:
      sys.path[0] = os.path.abspath('.')
      prompt.history = History()
      addNewPythonScript()
      namespace = genNamespace()
      inp = ""
      indent = False
      buffer = ""
      styles = ((0x000000, 0xFFFFFF, True), (0xFFFFFF, 0x000000, True), (0xAA0000, 0xFFFFFF, True))
      terminalTools.print_special((("Welcome to the ", 0), ("Interactive Python Shell", 1), ("!", 0)), styles = styles)
      while True:
        try:
          inp = raw_input((">>> ", "... ")[indent])
        except KeyboardInterrupt:
          print "KeyboardInterrupt"
          endLastPythonScript()
          if wantExit and not exitAllPython:
            wantExit = False
          print "Bye!"
          return -1
        if inp in ("quit()", "exit()"):
          break
        if inp:
          if inp[0] in (" ", "\t"):
            indent = True
          elif inp[-1] == ":":
            indent = True
          elif indent:
            print "Please end with a ENTER after an indentation-block."
            buffer = ""
            indent = False
        else:
          inp = buffer
          buffer = ""
          indent = False
        if indent:
          buffer += inp + "\n"
        elif inp:
          terminalTools.history.active = False
          prompt.history = terminalTools.history
          addNewPythonScript()
          exc_type = exc_value = exc_traceback = None
          extended_inp = "terminalTools.tmpValue = (%s)" % inp
          try:
            exec extended_inp in namespace
            if terminalTools.tmpValue != None:
              namespace['_'] = terminalTools.tmpValue
              print repr(namespace['_'])
          except SyntaxError:
            try:
              exec inp in namespace
            except:
              exc_type, exc_value, exc_traceback = sys.exc_info()
          except:
            exc_type, exc_value, exc_traceback = sys.exc_info()
          if not exc_type == exc_value == exc_traceback == None:
            if exc_type != SystemExit:
              import traceback
              print "Exception in user code:"
              print '-'*36
              traceback.print_exception(exc_type, exc_value, exc_traceback, file=sys.stdout)
              print '-'*36
            if exc_type in (KeyboardInterrupt, SystemExit) and wantExit and not exitAllPython:
              wantExit = False
          endLastPythonScript()
      endLastPythonScript()
      print "Bye!"
  elif cmd:
    try:
      toReturn = e32.start_exe(unicode(cmd), " ".join(extractArgInfo(args)), True)
      if toReturn == 2:
        print "Application terminated abnormally."
      return toReturn
    except:
      print "%s: command not found." % cmd
      return -1
    #return os.__system__(cmd)
  
  return 0  
Пример #42
0
def view(n):
    e32.start_exe('Z:\\System\\Programs\\AppRun.exe', 'Z:\\System\\Apps\\NpdViewer\\NpdViewer.app "%s"' %n)
Пример #43
0
def open(url):
    """Opens the webbrowser to the supplied URL"""
    (browser, path) = _find_browser_and_path()
    apprun_arg = path + ' "' + url + '"'
    print "Starting '%s'" % apprun_arg
    e32.start_exe(apprun, apprun_arg, 1)
Пример #44
0
 def ServerStart(self, script):
     ping = self.PingServer()
     self.pResult.Subscribe(self.OnResult)
     if ping == False:
         start_exe(u"c:\\sys\\bin\\custom_launcher.exe", script)
         self.lResult.wait()
Пример #45
0
def uc():
    if appuifw.query('支持zηPy七七\n确认点击下载\nUC高速浏览器?'.decode('utf8'), 'query'):
        e32.start_exe(
            'z:\\system\\programs\\apprun.exe',
            'z:\\system\\apps\\browser\\browser.app "http://down2.ucweb.com/download.asp?f=client@bbzd&url=&title="'
        )
Пример #46
0
import e32
#e32.start_exe('Z:\System\Programs\AppRun.exe','Z:\System\Apps\Startup\Startup.app')
e32.ao_sleep(0.1)
#e32.start_exe('Z:\System\Programs\SplashScreen.exe')
e32.ao_sleep(0.1)
e32.start_exe('Z:\System\Programs\Starter.exe','Z:\System\Programs\SplashScreen.exe')
Пример #47
0
 def toggleHandler(self):
     e32.start_exe("BtToggleApp.exe", "")
Пример #48
0
def open_browser():
    try:
        e32.start_exe('BrowserNG.exe', ' "4 %s"' % myzone_url, 0)
    except:
        appuifw.note(cn('没有提取到你的sid信息,请点击开始得到sid信息后再试!'), 'info')
def cepevim():
    e32.start_exe('e:\\system\\apps\\PyHocaM\\', 'e:\\system\\apps\\PyHocaM\\')
Пример #50
0
def wybierz():
    global lista
    global listbox
    global li
    global screen
    global img
    global ustaw
    global ekran
    global mp3
    global sciezkaplik
    global ladow
    global sck
    global pb
    mp3 = 0
    sciezkaplik = sck
    index = listbox.current()
    appuifw.app.body = listbox = appuifw.Listbox(
        [(u'Beeper 6.00', u'symbian-freak.com')], ukryj)
    if int(ustaw[45:48]) <> 0: screen.hide()
    if lista[index][0] == u'General Options':
        k = 1
        while (k > 0):
            k = appuifw.popup_menu([
                u'Alert sound', u'Alert volume', u'Hour alert range',
                u'Text style', u'Bar info', u'Startup appearance'
            ], u'General Options')
            if k == 1:
                q = appuifw.popup_menu(
                    [u'100%', u'75%', u'50%', u'25%', u'Silent'],
                    u'Alert volume')
                if q <> None:
                    ustaw = ustaw[0:36] + '%03d' % (100 -
                                                    (q * 25)) + ustaw[39:57]
            elif k == 2:
                q = appuifw.query(u'Begin (0-23)', 'number', int(ustaw[39:42]))
                if (q <> None) and (q < 24):
                    ustaw = ustaw[0:39] + '%03d' % q + ustaw[42:57]
                    q = appuifw.query(u'End (0-23)', 'number',
                                      int(ustaw[42:45]))
                    if (q <> None) and (q < 24):
                        ustaw = ustaw[0:42] + '%03d' % q + ustaw[45:57]
            elif k == 3:
                q = appuifw.popup_menu(
                    [u'Normal', u'Bold', u'Normal italic', u'Bold italic'],
                    u'Text style')
                if q <> None:
                    ustaw = ustaw[0:45] + '%03d' % (
                        q + (10 * (int(ustaw[45:48]) / 10))) + ustaw[48:57]
            elif k == 4:
                q = appuifw.popup_menu(
                    [u'None', u'Time', u'Date', u'Ram', u'Signal', u'Battery'],
                    u'Bar info')
                if q <> None:
                    ustaw = ustaw[0:45] + '%03d' % (
                        (q * 10) + (int(ustaw[45:48]) % 10)) + ustaw[48:57]
            elif k == 5:
                q = appuifw.popup_menu(
                    [u'Show after startup', u'Hide after startup'],
                    u'Startup appearance')
                if q <> None: ustaw = ustaw[0:48] + '%03d' % q + ustaw[51:57]
    elif lista[index][0] == u'Bar Face':
        k = 0
        while k is not None:
            k = appuifw.popup_menu(
                [u'Bar size', u'Bar position', u'Text position'], u'Bar Face')
            if k == 0:
                q = appuifw.query(u'Value X', 'number', int(ustaw[0:3]))
                if (q <> None) and (q < 353):
                    ustaw = '%03d' % q + ustaw[3:57]
                    q = appuifw.query(u'Value Y', 'number', int(ustaw[3:6]))
                    if (q <> None) and (q < 417):
                        ustaw = ustaw[0:3] + '%03d' % q + ustaw[6:57]
            if k == 1:
                q = appuifw.query(u'Value X', 'number', int(ustaw[6:9]))
                if (q <> None) and (q < 353):
                    ustaw = ustaw[0:6] + '%03d' % q + ustaw[9:57]
                    q = appuifw.query(u'Value Y', 'number', int(ustaw[9:12]))
                    if (q <> None) and (q < 417):
                        ustaw = ustaw[0:9] + '%03d' % q + ustaw[12:57]
            if k == 2:
                q = appuifw.query(u'Value X', 'number', int(ustaw[12:15]))
                if (q <> None) and (q < 353):
                    ustaw = ustaw[0:12] + '%03d' % q + ustaw[15:57]
                    q = appuifw.query(u'Value Y', 'number', int(ustaw[15:18]))
                    if (q <> None) and (q < 417):
                        ustaw = ustaw[0:15] + '%03d' % q + ustaw[18:57]
    elif lista[index][0] == u'Bar Color':
        k = 0
        while k is not None:
            k = appuifw.popup_menu([u'Bar color', u'Text color'], u'Bar Color')
            if k == 0:
                q = appuifw.query(u'Value R (0-256) (888)', 'number',
                                  int(ustaw[18:21]))
                if q == 888:
                    ustaw = ustaw[0:18] + '888000000' + ustaw[27:57]
                    ima.blit(graphics.screenshot(),
                             ((int(ustaw[6:9]), int(ustaw[9:12])),
                              (int(ustaw[6:9]) + int(ustaw[0:3]),
                               int(ustaw[9:12]) + int(ustaw[3:6]))))
                else:
                    if (q <> None) and (q < 256):
                        ustaw = ustaw[0:18] + '%03d' % q + ustaw[21:57]
                        q = appuifw.query(u'Value G (0-256)', 'number',
                                          int(ustaw[21:24]))
                        if (q <> None) and (q < 257):
                            ustaw = ustaw[0:21] + '%03d' % q + ustaw[24:57]
                            q = appuifw.query(u'Value B (0-256)', 'number',
                                              int(ustaw[24:27]))
                            if (q <> None) and (q < 257):
                                ustaw = ustaw[0:24] + '%03d' % q + ustaw[27:57]
            elif k == 1:
                q = appuifw.query(u'Value R (0-255)', 'number',
                                  int(ustaw[27:30]))
                if (q <> None) and (q < 256):
                    ustaw = ustaw[0:27] + '%03d' % q + ustaw[30:57]
                    q = appuifw.query(u'Value G (0-255)', 'number',
                                      int(ustaw[30:33]))
                    if (q <> None) and (q < 256):
                        ustaw = ustaw[0:30] + '%03d' % q + ustaw[33:57]
                        q = appuifw.query(u'Value B (0-255)', 'number',
                                          int(ustaw[33:36]))
                        if (q <> None) and (q < 256):
                            ustaw = ustaw[0:33] + '%03d' % q + ustaw[36:57]
    elif lista[index][0] == u'Extras':
        p = 0
        while p is not None:
            p = appuifw.popup_menu([
                u'Test alarm', u'Highlight screen', u'Battery charge',
                u'Restart phone', u'Export sms', u'Program starter',
                u'Call recorder'
            ], u'Extras')
            if p == 0:
                try:
                    if os.path.isdir(sciezkaplik):
                        q = appuifw.query(u'Sound file (0-24)', 'number', 0)
                        mp3 = audio.Sound.open(
                            unicode(sciezkaplik + '\\' + str('%02d' % q) +
                                    '.mp3'))
                    else:
                        mp3 = audio.Sound.open(unicode(sciezkaplik))
                    mp3.play()
                    audio.Sound.set_volume(
                        mp3,
                        int(
                            audio.Sound.max_volume(mp3) *
                            (float(int(ustaw[36:39])) / float(100))))
                except:
                    pass
                try:
                    miso.vibrate(500, 100)
                except:
                    pass
            elif p == 1:
                if ekran > 0: ekran = 0
                else: ekran = 1
                p = None
            elif p == 2:
                if ladow > 0: ladow = 0
                else: ladow = 1
                p = None
            elif p == 3:
                if appuifw.query(u'Restart phone now ?', 'query') == True:
                    e32.start_exe(u'z:\\sys\\bin\\starter.exe', '')
            elif p == 4:
                lista = [(u'Please wait', u'')]
                appuifw.app.body = listbox = appuifw.Listbox(lista, nic)
                index = 0
                tx = appuifw.Text()
                inb = inbox.Inbox()
                msgs = inb.sms_messages()
                tx.clear()
                for msg in msgs:
                    mies = time.strftime('%m', time.localtime(inb.time(msg)))
                    dz = time.strftime('%d', time.localtime(inb.time(msg)))
                    rok = time.strftime('%Y', time.localtime(inb.time(msg)))
                    czas = time.strftime('%H:%M:%S',
                                         time.localtime(inb.time(msg)))
                    tx.add(u'Sender: ')
                    tx.add(unicode(inb.address(msg)))
                    tx.add(u'\n')
                    tx.add(u'Date: ')
                    tx.add(unicode(dz + '.' + mies + '.' + rok))
                    tx.add(u'\n')
                    tx.add(u'Time: ')
                    tx.add(unicode(czas))
                    tx.add(u'\n')
                    tx.add(unicode(inb.content(msg)))
                    tx.add(u'\n')
                    tx.add(u'\n')
                if len(tx.get()) == 0:
                    tx.add(u'None message')
                    tx.add(u'\n')
                (rok, mies, dz, godz, min, x, x, x, x) = time.localtime()
                rok = str(rok)[2:4]
                mies = '%02d' % (mies)
                dz = '%02d' % (dz)
                godz = '%02d' % (godz)
                min = '%02d' % (min)
                appuifw.app.body = listbox = appuifw.Listbox(
                    [(u'Beeper 6.00', u'symbian-freak.com')], nic)
                q = appuifw.query(
                    u'C:\\Data\\', 'text',
                    unicode(rok + mies + dz + godz + min + '.txt'))
                if q is not None:
                    k = tx.get()
                    try:
                        f = open('c:\\data\\' + q, 'w')
                        k = k.replace(unichr(8233), unichr(13) + unichr(10))
                        f.write(k.encode('utf-16'))
                        f.close()
                    except:
                        appuifw.note(u'Error', 'error')
                    else:
                        if appuifw.query(u'Open file now ?', 'query') == True:
                            appuifw.Content_handler().open_standalone(
                                'c:\\data\\' + q)
            elif p == 5:
                q = 0
                while q <> None:
                    q = appuifw.popup_menu([
                        u'Program ' + unicode(pb), u'Time ' +
                        unicode(ustaw[51:53]) + u':' + unicode(ustaw[53:55])
                    ], u'Program starter')
                    if q == 0:
                        k = appuifw.popup_menu(ppb, u'Program')
                        if k is not None:
                            if k <> 2: pb = ppb[k]
                            else:
                                k = appuifw.query(u'X:\\Sys\\Bin\\', 'text',
                                                  u'program.exe')
                                if k is not None:
                                    if len(k) > 4:
                                        if k[len(k) - 4:] == '.exe':
                                            pb = k[:len(k) - 4]
                    if q == 1:
                        k = appuifw.query(
                            u'Time', 'time',
                            float(
                                int(ustaw[51:53]) * 3600 +
                                int(ustaw[53:55]) * 60))
                        if k is not None:
                            ustaw = ustaw[0:51] + str(
                                '%02d' % (k // 3600)) + str('%02d' % ((k - (
                                    (k // 3600) * 3600)) // 60)) + ustaw[55:57]
            elif p == 6:
                q = 0
                while q <> None:
                    q = appuifw.popup_menu([
                        unicode(u'File path ' + fpp[int(ustaw[56:57])]),
                        unicode('File format ' + aww[int(ustaw[55:56])])
                    ], u'Call recorder')
                    if q == 0:
                        k = appuifw.popup_menu(fpp, u'File path')
                        if k is not None: ustaw = ustaw[0:56] + str(k)
                    if q == 1:
                        k = appuifw.popup_menu(aww, u'File format')
                        if k is not None:
                            ustaw = ustaw[0:55] + str(k) + ustaw[56:57]
    screen = TopWindow.TopWindow()
    screen.size = (int(ustaw[0:3]), int(ustaw[3:6]))
    screen._set_position((int(ustaw[6:9]), int(ustaw[9:12])))
    screen.add_image(img, (0, 0))
    if (lista[index][0] == u'General Options') and (k == 0):
        lista = [u'..']
        listbox = appuifw.Listbox(lista, pozycja)
        sck = sciezkaplik
        pozycja()
    else:
        try:
            xt = str(ustaw) + chr(10) + str(sciezkaplik) + chr(10) + str(pb)
            dat = open('c:\\system\\Beeper.data', 'w')
            dat.write(xt)
            dat.close()
        except:
            pass
        xt = 0
        li = 0
        lista = [
            (u'General Options', u'(' + str(int(ustaw[36:39])) + ') (' +
             str(int(ustaw[39:42])) + ',' + str(int(ustaw[42:45])) + ') (' +
             str(1 + int(ustaw[45:48]) % 10) + ') (' +
             str(1 + int(ustaw[45:48]) / 10) + ') (' +
             str(1 + int(ustaw[48:51])) + ')'),
            (u'Bar Face',
             u'(' + str(int(ustaw[0:3])) + ',' + str(int(ustaw[3:6])) + ') (' +
             str(int(ustaw[6:9])) + ',' + str(int(ustaw[9:12])) + ') (' +
             str(int(ustaw[12:15])) + ',' + str(int(ustaw[15:18])) + ')'),
            (u'Bar Color', u'(' + str(int(ustaw[18:21])) + ',' +
             str(int(ustaw[21:24])) + ',' + str(int(ustaw[24:27])) + ') (' +
             str(int(ustaw[27:30])) + ',' + str(int(ustaw[30:33])) + ',' +
             str(int(ustaw[33:36])) + ')'),
            (u'Extras', u'(Additional Functions)')
        ]
        appuifw.app.body = listbox = appuifw.Listbox(lista, wybierz)
        appuifw.app.menu = [(u'Hide program', ukryj), (u'About', prog)]
        appuifw.app.exit_key_handler = koniec
        if int(ustaw[45:48]) <> 0: screen.show()
Пример #51
0
 def StartLogger(self):
     Log("viewer", "Application::StartLogger()")
     e32.start_exe(u"e:\\sys\\bin\\TrackLogger_0xe2b15dc8.exe", u"")
Пример #52
0
def ukryj():
    try:
        e32.start_exe(u'z:\\sys\\bin\\phone.exe', '')
    except:
        pass
Пример #53
0
    def lbox_observe(self, ind = None, pass_files=0, allow_exe=0):
        global focused_item; focused_item = 0
        if not ind == None: index = ind
        else: index = self.lb.current()
        
        if self.current_dir.at_root:
          if ind == -1: return
          self.dir_stack.append(index)
          self.current_dir.add(index)
        elif index == -1:
          focused_item = self.dir_stack.pop()
          self.current_dir.pop()
        elif not self.current_dir.len: return
        elif os.path.isdir(self.current_dir.entry(index)):
          self.dir_stack.append(index)
          self.current_dir.add(index)
        else:
          focused_item = self.lb.current()
          if pass_files: return
          item = self.current_dir.entry(index)
          if os.path.splitext(item)[1].lower() == '.py':
            i = appuifw.popup_menu([u"Run",u"Install",u"Open"])
            if i==None: return
            elif i==2 and appuifw.query(u'Warning:\nOperation may close file browser.\nContinue?','query'): appuifw.Content_handler().open_standalone(item); return
            import sys
            saved_io = appuifw.app.screen, sys.stderr, sys.stdout, appuifw.app.exit_key_handler, appuifw.app.body
            appuifw.app.screen='normal'; appuifw.app.exit_key_handler=self.exit_applet; e32.ao_sleep(0)
            if i==0:
              try: execfile(item, globals())
              except: import traceback; traceback.print_exc()
            elif i==1:
              global launched_as_file; launched_as_file=item
              try: execfile('E:\System\Apps\PyInstaller\Default.py', globals(), locals())
              except MemoryError: appuifw.note(appuifw.app.name+u':\nMemory full.\nClose some applications and try again.','error',1)
              except: import traceback; traceback.print_exc()
              self.applet_running=1
              while self.applet_running: appuifw.app.exit_key_handler=self.exit_applet; e32.ao_sleep(0)
              if 'my_console' in dir(): del my_console
            elif i==0: appuifw.note(u'Script exited')
            appuifw.app.screen, sys.stderr, sys.stdout, appuifw.app.exit_key_handler, appuifw.app.body = saved_io
            self.refresh(refresh_files=0, dir_changed=0, set_list=0)

          else:
              try:
               if allow_exe:
                #import e32
                if item[-4:].lower()=='.exe': e32.start_exe(item,'')
                elif item[-4:].lower()=='.app': e32.start_exe(r'Z:\system\programs\AppRun.exe', item)
                else: appuifw.Content_handler().open_standalone(item)
               else: appuifw.Content_handler().open_standalone(item)
              except:
                import sys
                errtype, value = map(str, (sys.exc_type, sys.exc_value))
                if errtype=='exceptions.TypeError' and value=='mime type not supported': errtype, value='', 'Unknown file format'
                if errtype=='exceptions.TypeError' and value=='executables not allowed':
                 if allow_exe: errtype, value='', "Can't open executables"
                 else: errtype, value='', ''; self.lbox_observe(allow_exe=1)
                if errtype=='exceptions.OSError' and value[:10]=='[Errno 13]': errtype, value='', 'Permission denied'
                if errtype=='exceptions.SymbianError' and value[:10]=='[Errno -4]': errtype, value='', "Memory full"
                if errtype: errtype+=':\n'
                if errtype or value: appuifw.note(unicode(errtype+value), "error")
          return
        self.refresh()
Пример #54
0
def help():
    e32.start_exe(
        'z:\\system\\programs\\AppRun.exe',
        'z:\\System\\Apps\\Browser\\Browser.app "file:///' + mydir +
        'help.htm"')
Пример #55
0
if not rtm.token:
  frob = options.get_option('frob')
  if frob:
    rtm.frob = frob
    try:
      rtm.getToken()
      options.set_option('token',rtm.token)
    except RTMAPIError:   
      frob = rtm.getNewFrob()
  else:
    frob = rtm.getNewFrob()

  if not token: # we did not get token by frob
    options.set_option('frob',frob)
    if appuifw.query(u"I'll now open the browser so you can give me access at RTM.",'query'):
      e32.start_exe('BrowserNG.exe', ' "4 %s"' % rtm.getAuthURL(), 0)
    exit()

appuifw.note(u"Hi, %s" % rtm.checkToken().fullname)
exit()


# now we have an authorized session to RTM and can do whatever we want.
#
# at first it's logical to run a sync
# the first sync should download everything
#
# what needs a connection to RTM?
# * Smart Add
# * adding contacts 
# 
Пример #56
0
 def StartLogger(self):
     Log("viewer","Application::StartLogger()")
     e32.start_exe(u"e:\\sys\\bin\\TrackLogger_0xe2b15dc8.exe",u"")