×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    5

    Python Scripting Language (PSP)

    Hi Guys,
    Is there any resources for scripting using Python Scripting Language available either on this forum or elsewhere on the net? It's a bit of a funny issue really, as if you search for PSP scripts you usually get a load of pages for Sony's console. Scripts specifically for Raccoon and Python S60 features / modules are what I'm after to expand my own mobsite.

    What I'm trying to achieve is a small calendar unit on the right hand side of a scheduling section which draws a mini calendar and has a link only on the days where something is in the calendar for that particular day. Like an event calendar so to speak. When you click on the link it refreshes the left of the page with a list of what you have scheduled for that day.

    I can work out the admin side of things so that people (with proper access) can add / amend / delete calendar entries, it's just this calendar browsing function that I'm after. Much like the built in calendar example but using PSP and able to change the look using CSS style sheets and with links on the days which have data rather than listing the items in the day itself as the calendar object on the right has to be rather compact.

    For an example think about the calendars which airline websites typically have or actually thinking about it, a web-based version of the built-in calendar. Is this possible?

    Cheers guys!
    Last edited by fortina; 2007-02-06 at 22:45.

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Python Scripting Language (PSP)

    Quote Originally Posted by fortina
    For an example think about the calendars which airline websites typically have or actually thinking about it, a web-based version of the built-in calendar. Is this possible?
    Sure, that's quite possible. Unfortunately, however, I'm not aware of any PSP script repositories like the ones you can find for PHP. If you find any, please let me know.

    It's probably relatively straightforward to take an existing PHP calendar implementation and translate it to PSP. Then it just takes some additional programming to hook the code up with the phone's calendar...

    Sorry for not being able to give better advice/pointers.
    Last edited by jhnwkmn; 2007-02-09 at 08:32.

  3. #3
    Registered User
    Join Date
    Feb 2007
    Posts
    5

    Re: Python Scripting Language (PSP)

    Cheers for the advice. I never realised how many commands are similar between Python and PHP! I have programmed a calendar before from one of our clients in ASP... well I really modified an existing script but it helped me understand it more easily.

    ASP has more date handling commands for example for getting the first day (as integer) of the month and so on so I was looking for a Python equivelant of the ASP script and was struggling. Never thought of checking PHP but I now have a working calendar module which is able to draw the current month which I can hopefully expand on.

    I managed this by translating a simple PHP calendar script. It's like translating a piece of French text into German (both of which I'm not familiar with) but I'm getting there!

  4. #4
    Registered User
    Join Date
    Feb 2007
    Location
    Espoo, Finland
    Posts
    6

    Re: Python Scripting Language (PSP)

    Hello,
    my phone status query with Raccoon has raised a lot of interest:

    Hi, i like this - Check my phone (040-707 1093) status i.e. (http://risto.mononen.at.openlaborato...sp/status.psp). How did you set that up. Pls send me the files or link to <user@domain>. Thanx

    I have the relevant code zipped already, but don't know where to upload. Would opensource.nokia.com or wiki.opensource.nokia.com be appropriate? Naturally I can send the code to individual users, but probably it has wider interest and web upload would be a better choice.
    BR,
    http://Risto.Mononen.at.openlaboratory.net

  5. #5
    Registered User
    Join Date
    Feb 2007
    Posts
    5

    Re: Python Scripting Language (PSP)

    The Python for S60 Wiki has a section where people have been posting up examples of code that they think other people in the developer community will find usefull so maybe a section in the Raccoon Wiki could be created for the same purpose. You would have to upload the zip file to a server which you have access to and link to it from there.

    Also another thing you could do is have the zip file on your mobsite available for download. This all depends on the data plan you have (i.e. how much you pay for your data transfer) and how often your mobsite is active as you want the file to be available as much as possible and also don't want too many downloads from your mobsite if you are paying for the data transfer.

    Good luck!
    Last edited by fortina; 2007-02-13 at 23:06.
    Part of the design and development team at Pixel8 Design in Manchester, UK
    http://www.pixel8limited.com
    http://graham.brown.at.openlaboratory.net

  6. #6
    Registered User
    Join Date
    Feb 2007
    Location
    Espoo, Finland
    Posts
    6

    Re: Python Scripting Language (PSP)

    Hello,
    the whole script is quite short and I decided to copy it below. At some point there used to be a separate library (".pyd") but now it all is part of the python API - sysinfo.active_profile().

    BR, risto


    Code:
    <html>
    <head>
    <title>Risto's phone status info</title>
    <link rel="stylesheet" media="screen" type="text/css"
    href="http://raccoon.openlaboratory.net/RaccoonOnMap/css/docs.css" />
    </head>
    
    
    
    
    <body>
    
    <h1>My phone is in 
    
    <%
    import sysinfo
    pname = sysinfo.active_profile()
    
    req.write("\n<em>")
    req.write(pname)
    req.write("</em>\n")
    
    %>
    
    	mode</h1>
    
    <p>
    
    <dl>
    <dt>General
    	<dd>I am currently in the office and you can call me now
    <dt>Silent
    	<dd>I am currently in a quiet place, please do not call me now
    <dt>Meeting
    	<dd>I am currently in a meeting; messaging is preferred over
    	voice calls
    <dt>Outdoor
    	<dd>I am currently outdoor: on the road, shopping, sport
    	activities, etc, but I might answer to your call
    <dt>Pager
    	<dd>I can read your messages but will not answer the phone (I
    hardly ever use this one)
    </dl>
    
    
    </body>
    </html>
    Last edited by risto.mononen; 2007-02-16 at 19:22. Reason: improved the script
    BR,
    http://Risto.Mononen.at.openlaboratory.net

  7. #7
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Python Scripting Language (PSP)

    There is actually a section - http://wiki.opensource.nokia.com/projects/MWS:CoolStuff - at the Raccoon wiki site where links to code, demos, etc. can be put.

    Due to the legal overhead it would cause, code or zip-files or anything like that should not be put there directly, but, as fortina suggests, be made available on some other server over which you are in control, and then only a link be added to the Wiki page.

    However, it's fine to post code snippets, like the one below, here.

Similar Threads

  1. Please help installing Python libraries on S60
    By ericroijen in forum Symbian
    Replies: 11
    Last Post: 2009-07-18, 10:43
  2. How to install python to S60 Emulator?
    By xiximato in forum Symbian
    Replies: 14
    Last Post: 2009-03-10, 12:13
  3. Required SDK for s60 python language
    By mohib in forum Symbian
    Replies: 2
    Last Post: 2006-10-11, 22:09
  4. xhtml and scripting language
    By bubbatls in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2003-07-23, 06:49
  5. What is the scripting language of XHTML?
    By rotopark in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2003-04-03, 12:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×