×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    176

    [announce] Profiles 1.0.0 for PyS60 1.9.x

    Hi everyone,

    struggled to port xprofile, due to changes in Profiles Engine API with 3rd Ed.FP1. Therefore, created a similar extension from new myself

    Download Here.

    Usage:
    Code:
    profiles.profiles()
        #returns a List containing (profile Id, profile Name)
    
    profiles.get_ap() 
         #returns the id of the currently active profiles
    
    profiles.set_ap(pId)
         #changes the active profile to that of the profile Id
    Code:
    # example 
    
    def changeprofile():
      L=[]
      for item in profiles.profiles():
        L.append(item[1])
      i=appuifw2.popup_menu(L,u'Profiles')
      if i>-1: profiles.set_ap(profiles.profiles()[i][0])
    If any further functionality is required, i'll be happy to upgrade the extension

    Happy Pythoning!
    Last edited by the86hitman; 2009-08-26 at 01:48.
    The86Hitman
    PyS60 1.9.7 on E71
    http://www.drhtailor.com/pys60

  2. #2
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    101

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    Excellent! Thanks

    One annoyance of my phone is the noise it makes when I take a picture. This lets me write a trivial program to silence the camera:

    Code:
    import e32, profiles
    
    cp = profiles.get_ap()  # get current profile
    profiles.set_ap(1)      # set silent profile
    e32.start_exe(r'z:\sys\bin\Camcorder.exe', '', 1) # launch the camera and wait
    profiles.set_ap(cp)     # restore profile on return
    Alas, I don't seem able to sign it with adequate permissions
    Last edited by foosion; 2009-08-26 at 01:34.

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    176

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    Quote Originally Posted by foosion View Post
    Excellent! Thanks

    One annoyance of my phone is the noise it makes when I take a picture. This lets me write a trivial program to silence the camera:

    Code:
    import e32, profiles
    
    cp = profiles.get_ap()  # get current profile
    profiles.set_ap(1)      # set silent profile
    e32.start_exe(r'z:\sys\bin\Camcorder.exe', '', 1) # launch the camera and wait
    profiles.set_ap(cp)     # restore profile on return
    Alas, I don't seem able to sign it with adequate permissions
    Haha yehhh i know what you mean wrt to the camera noise!

    What are you unable to sign? Your script or the extension?
    The86Hitman
    PyS60 1.9.7 on E71
    http://www.drhtailor.com/pys60

  4. #4
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    101

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    The script works fine.

    I had no trouble signing with open signing. The problem is running the signed program - I'm getting a permissions error

  5. #5
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    Sigh,

    Don't want to complain, but I seem to be... Just that I'm a big fan of natural naming and prefer names which are self-documenting. Therefore I would have done maybe:

    profiles.get_ap() --> profiles.current, profiles.set_ap(pId) --> profiles.activate(pId)

    Proposal for your next extension, to think about more "natural" names?

    Btw that camera sound: some countries have legislation, which defines that camera phones must make a certain kind of noise when a picture is taken. Therefore I would guess that any sw which removes that obligatory noise might be illegal in those countries. Wouldn't release such sw e.g. in USA, The Promised Land of Lawyers. Serious stuff, when you think about it.

    Cheers,

    --jouni who does find the camera noise annoying

  6. #6
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    101

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    It's just a quick-and-dirty app, most likely just for me. In general I agree with you - more natural names are much better for making code more understandable.

    I'm in the US. We don't have any such law, although a while back some politician got some publicity by suggesting a ban on silent cameras.

    The error message:

    Code:
    Traceback (most recent call last):
     File "launcher.py", line 43, in <module>
       execfile('default.py', default_namespace)
     File "default.py", line 4, in <module>
       profiles.set_ap(1)      # set silent profile
    SymbianError: [Errno -46] KErrPermissionDenied
    Any suggestions? The program works from the interpreter.

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    hello foosion

    the KErrPermisionDenied is the error for insufficient capabilities, and i am asuming that you are working on the Python shell so have you signed your python shell properly???

    Enjoy Pythoning

  8. #8
    Regular Contributor
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    176

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    Quote Originally Posted by JOM View Post
    Sigh,

    Don't want to complain, but I seem to be... Just that I'm a big fan of natural naming and prefer names which are self-documenting. Therefore I would have done maybe:

    profiles.get_ap() --> profiles.current, profiles.set_ap(pId) --> profiles.activate(pId)

    Proposal for your next extension, to think about more "natural" names?
    Thank you for your comments. Maybe its personal opinion, some individuals prefer things to be named in different ways.

    The quick fix is to edit the .py wrapper but if more features are requested for this extension, then in the next release, i'll change the naming to what you have suggested.

    As for camera sounds, i've read that somewhere too- camera must make a sound. Otherwise voyeurs will be taking plenty of dodgy pics wherever the camera fits, LoL...
    However, switchin to Silent disables camera sounds on my E71 but not on E65.
    The86Hitman
    PyS60 1.9.7 on E71
    http://www.drhtailor.com/pys60

  9. #9
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    101

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    Quote Originally Posted by gaba88 View Post
    the KErrPermisionDenied is the error for insufficient capabilities, and i am asuming that you are working on the Python shell so have you signed your python shell properly???
    The program works in the interpreter (i.e., ScriptShell) but not as a standalone program. Should I be signing runtime 1.9.7? The only signing capability I have is Open Signed Online, which says SIS files can be signed for all Platform Security Capabilities except CommDD, MultimediaDD, NetworkControl, DiskAdmin, DRM, AllFiles, TCB. Changing profiles (which generated the permissions error) does not seem to be on this list. As I understand, MultimediaDD lets you control the camera, but not change its priority.

    Terminology issue: there's a script which runs in the interpreter (ScriptShell). You can turn a script into a sis program and install and run that. There's extension.

    Both the sis program and extension can be signed with open signed. My use of the extension in a sis program generates a permissions error.
    Last edited by foosion; 2009-08-26 at 11:45.

  10. #10
    Regular Contributor
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    176

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    runtime doesnt need signing.
    but its catchin on line 4 ??
    mayb try comment out the profiles swithchin lines and see if at least the camera loads..
    The86Hitman
    PyS60 1.9.7 on E71
    http://www.drhtailor.com/pys60

  11. #11
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    101

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    Quote Originally Posted by the86hitman View Post
    runtime doesnt need signing.
    but its catchin on line 4 ??
    mayb try comment out the profiles swithchin lines and see if at least the camera loads..
    I tried commenting out some lines, turning to sis files, signing and installing:

    Commenting out the profile lines and running just the camera -> worked
    Commenting out the camera line and running just the profile changer -> KErrPermissionDenied at the first profile change

  12. #12
    Regular Contributor
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    176

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    Quote Originally Posted by foosion View Post
    I tried commenting out some lines, turning to sis files, signing and installing:

    Commenting out the profile lines and running just the camera -> worked
    Commenting out the camera line and running just the profile changer -> KErrPermissionDenied at the first profile change
    the mmp file for profiles has these caps (even tho only the ones in italics are required.):

    CAPABILITY LocalServices Location NetworkServices PowerMgmt ProtServ ReadDeviceData ReadUserData SurroundingsDD SwEvent TrustedUI UserEnvironment WriteDeviceData WriteUserData

    altho your sis will install and run, mayb it also needs all these caps to work to execute the profiles api?
    also,the extension will only work with FP1 and later.
    The86Hitman
    PyS60 1.9.7 on E71
    http://www.drhtailor.com/pys60

  13. #13
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    101

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    Quote Originally Posted by the86hitman View Post
    the mmp file for profiles has these caps (even tho only the ones in italics are required.):

    CAPABILITY LocalServices Location NetworkServices PowerMgmt ProtServ ReadDeviceData ReadUserData SurroundingsDD SwEvent TrustedUI UserEnvironment WriteDeviceData WriteUserData

    altho your sis will install and run, mayb it also needs all these caps to work to execute the profiles api?
    Open Signed should provide these caps. SIS files can be signed for all Platform Security Capabilities except CommDD, MultimediaDD, NetworkControl, DiskAdmin, DRM, AllFiles, TCB.

    I may not understand your question.

    Quote Originally Posted by the86hitman View Post
    also,the extension will only work with FP1 and later.
    I'm using an E63 which has FP1. The code works when executed from the interpreter/scriptshell, so my OS would seem to have the necessary abilities.

  14. #14
    Regular Contributor
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    176

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    solved! (except,the path to camera app didnt work on my fone) you DO need to specify required caps, i tested with full caps:
    Code:
    --caps=LocalServices+Location+NetworkServices+PowerMgmt+ProtServ+ReadDeviceData+ReadUserData+SurroundingsDD+SwEvent+TrustedUI+UserEnvironment+WriteDeviceData+WriteUserData
    in the ensymble documentation:
    Note: By default, the sis files are generated with the following capabilities: LocalServices, NetworkServices, ReadUserData, WriteUserData, UserEnvironment
    but i'm sure it should also work with Read/WriteDeviceData specified, as i mentiond that it is required for profiles to work in the post #12.
    The86Hitman
    PyS60 1.9.7 on E71
    http://www.drhtailor.com/pys60

  15. #15
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    101

    Re: [announce] Profiles 1.0.0 for PyS60 1.9.x

    That worked

    I found path to camera using your applist

    thanks

Similar Threads

  1. [Announce] appuifw2 1.0.0
    By y.a.k in forum Symbian
    Replies: 72
    Last Post: 2011-12-07, 11:32
  2. [Announce] pygame for S60 for PyS60 1.9.x
    By GameDude in forum Symbian
    Replies: 57
    Last Post: 2011-02-21, 23:18
  3. [announce] applist for 1.9.x
    By the86hitman in forum Symbian
    Replies: 22
    Last Post: 2009-08-27, 15:06
  4. [Announce] Miso 1.97 for PyS60 1.9.x
    By aaaaapo in forum Symbian
    Replies: 9
    Last Post: 2009-06-18, 00:24
  5. Replies: 84
    Last Post: 2008-03-04, 23:25

Posting Permissions

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