Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)

    Reply
    Page 6 of 20 | Prev |   4     5   6   7     8   16 | Next | Last
    noobmonkey | # 51 | 2010-02-18, 23:34 | Report

    Originally Posted by hartti View Post
    Ok. Calling that through os.popen() seems to work. Cool.
    (I was expecting there to be a python module for getting this without command line stuff :-)

    Thanks qwerty12!

    Hartti

    There is - Qwerty's post stated -
    "osso-product-info -q OSSO_PRODUCT_RELEASE_VERSION"

    But i havn't tried using it


    At least it works

    Edit | Forward | Quote | Quick Reply | Thanks

     
    hartti | # 52 | 2010-02-18, 23:43 | Report

    I was expecting that there is a method yyyy in module xxxx, which I could just call and get the version number. Like
    version = yyyy.xxxx()

    I got qwerty12's trick to work with the following code. To me that still looks like calling a command line command from the python code :-)

    import os
    a = os.popen("osso-product-info -q OSSO_PRODUCT_RELEASE_VERSION")
    version = a.next()
    a.close()

    Hartti

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to hartti For This Useful Post:
    noobmonkey

     
    noobmonkey | # 53 | 2010-02-18, 23:46 | Report

    Originally Posted by hartti View Post
    I was expecting that there is a method yyyy in module xxxx, which I could just call and get the version number. Like
    version = yyyy.xxxx()

    I got qwerty12's trick to work with the following code. To me that still looks like calling a command line command from the python code :-)

    import os
    a = os.popen("osso-product-info -q OSSO_PRODUCT_RELEASE_VERSION")
    version = a.next()
    a.close()

    Hartti

    AHhh good point - dont think there is an api/lib for everything yet - a few i have read looked great until i saw the line (FIX: Blah blah not working, needs to be added)

    Work in progress! - if you do find a better way, would be nice to know

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 54 | 2010-02-19, 13:03 | Report

    anyone know a way to list all repo's and determine enabled v disabled?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    hartti | # 55 | 2010-02-19, 16:55 | Report

    let's wait for qwerty12 to answer :-)

    Hartti

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to hartti For This Useful Post:
    noobmonkey

     
    fatalsaint | # 56 | 2010-02-19, 17:19 | Report

    Well.. this probably won't work and is certainly overly complicated.. but I don't know of a way to list repo's directly from apt. This makes use of tricks with find and grep, both of which are probably bastardized versions on the N900 and will probably not work.

    Code:
    #!/usr/bin/python                                                               
    import commands                                                                 
                                                                                    
    enabled = commands.getoutput('find /etc/apt -name *.list -exec grep -v "^#" {} \
    ; | grep -v "^$"')                                                              
    disabled = commands.getoutput('find /etc/apt -name *.list -exec grep "^#" {} \; 
    | grep -Ev "^#\W*$"')                                                           
                                                                                    
    print "Enabled Repositories \n\n" + enabled                                     
                                                                                    
    print "\n\nDisabled Repositories \n\n" + disabled
    Fortunately.. you could totally python-ify this which would work on the N900... just search for all *.list files in /etc/apt and open them, then look for a # at the beginning of the line. Those with a # are disabled, those without are enabled.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to fatalsaint For This Useful Post:
    noobmonkey, qwerty12

     
    fatalsaint | # 57 | 2010-02-19, 17:24 | Report

    Code:
    apt-cache policy
    Will show active repo's it appears..

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to fatalsaint For This Useful Post:
    evad, noobmonkey, qwerty12

     
    qwerty12 | # 58 | 2010-02-19, 17:27 | Report

    Originally Posted by noobmonkey View Post
    anyone know a way to list all repo's and determine enabled v disabled?
    If you mean disabled in the sense that it's been unticked (well, the "disabled" button for a particular catalogue ticked) in the Application Manager, you can look in the file /etc/hildon-application-manager/catalogues and disabled catalogues will have an <disabled/> element.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to qwerty12 For This Useful Post:
    fatalsaint, noobmonkey

     
    fatalsaint | # 59 | 2010-02-19, 17:29 | Report

    Originally Posted by qwerty12 View Post
    If you mean disabled in the sense that it's been unticked in the Application Manager, you can look in the file /etc/hildon-application-manager/catalogues and disabled catalogues will have an <disabled/> element.
    That's kind of cool... will that show repo's that are in the normal sources.list as well as hildon-application-manager.list (or whatever that one was called)? Or just those that HAM controls? (I would assume the latter.. but never know.)

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to fatalsaint For This Useful Post:
    noobmonkey

     
    qwerty12 | # 60 | 2010-02-19, 17:31 | Report

    Originally Posted by fatalsaint View Post
    That's kind of cool... will that show repo's that are in the normal sources.list as well as hildon-application-manager.list (or whatever that one was called)? Or just those that HAM controls? (I would assume the latter.. but never know.)
    Pretty sure it's the latter, AFAIK.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to qwerty12 For This Useful Post:
    fatalsaint, noobmonkey

     
    Page 6 of 20 | Prev |   4     5   6   7     8   16 | Next | Last
vBulletin® Version 3.8.8
Normal Logout