Jump to content

gnounc

Active Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by gnounc

  1. [uPDATED]

    Almost all of this code has been tested as working in chunks.

    anything that doesnt work is likely down to bad syntax, and so far the only thing

    I can peg as not working is the callbacks at the bottom.

    I think this has something to do with me trying to call a class, because I had it working

    with regular functions.

    also if anyone knows how to retrieve buddy icons over dbus in pidgin, thats the last thing I dont have working.

    any help would be greatly appreciated.

     
    #!/usr/bin/env python
    import os, gtk, pygtk, dbus, gobject
    from dbus.mainloop.glib import DBusGMainLoop
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
    
    
    bus = dbus.SessionBus()
    obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
    purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
    
    
    def quit_cb(widget, data = None):
        if data:
            data.set_visible(False)
        gtk.main_quit()
    
    def popup_menu_cb(widget, button, time, data = None):
        if button == 3:
            if data:
                data.show_all()
                data.popup(None, None, None, 3, time)
    
    
    
    
    class buddy:
            def __init__(self, buddy, icon='offline.png'):
                    self.buddy = buddy
                    self.icon = icon
                    statusIcon = gtk.StatusIcon()
                    menu = gtk.Menu()
                    menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT)
                    menu.append(menuItem)  
                    statusIcon.connect('popup-menu', popup_menu_cb, menu)
                    statusIcon.set_visible(True)
                    menuItem.connect('activate', quit_cb, statusIcon)
    
    
    
            def online(icon):
                    statusIcon.set_from_file(icon)
                    statusIcon.set_tooltip('Online')
    
    
            def offline():
    
                    statusIcon.set_from_file('offline.png')
                    statusIcon.set_tooltip('Offline')
    
            setIcon(icon)
    
    
    
    
    try:
            f = open('buddies.cfg')
            try:
                    for line in f.readlines():
                            buddy(line)
            finally:
                    f.close()
    
    ### right now it doesnt grab buddy icon from anywhere...connect the proper callback to the class buddy
    ## to make it grab buddy icon from pidgin properly
    ### not sure if buddy.online/buddy.offline is the proper way to use those callbacks, but i think it is.
    ### also not sure if callbacks will trample over the icons made by the buddy list, or if they will run twice..
    ## not sure how to make it cooperate if not
    
    ##### and lastly, ffs; remember to drop the hardcoded filepaths!!!
    
    bus.add_signal_receiver(buddy.online, dbus_interface="im.pidgin.purple.PurpleInterface", signal_name="BuddySignedOn")
    bus.add_signal_receiver(buddy.offline, dbus_interface="im.pidgin.purple.PurpleInterface", signal_name="BuddySignedOff")
    bus.add_signal_receiver(quit_cb, dbus_interface="im.pidgin.purple.PurpleInterface", signal_name="AccountSignedOff")
    
    
    gtk.main()
    
    

  2. I have wx installed.

    console error in windows is :

    grooveshark gui.py line 526 in <module> settings.config.write(f)

    NameError: name 'settings' is not defined

    I get no errors on module dependancies when I type import <module name> for each in IDLE

    i have wxpython installed, httlib2 installed, python 2.6 installed the newest grooveshark GUI.py provided

    and the newest distrobution.7zip

  3. STARTING LOG

    Current Folder After: C:\Documents and Settings\Administrator\Desktop\distrobution\distrobution

    ------Directory-----------

    Folder: C:/Documents and Settings/Administrator/Desktop/distrobution/distrobution

    1. app.log

    2. ConfigParser

    3. download.py

    4. g8831.png

    5. Grooveshark GUI.py

    6. Grooveshark.py

    7. Grooveshark.pyc

    8. json

    9. mplayer

    10. mplayer.exe

    11. Mplayer.py

    12. Music

    13. os

    14. Player.py

    15. settings.cfg

    16. stream.py

    17. subprocess

    18. sys

    19. test.bat

    20. time

    In windows, the cmd opened, said some stuff, then closed down, no gui popped up.

  4. I couldnt get it to work in crunchbang linux either, but i think thats just me (and crunchbang).

    I'm not sure i have httplib2 installed properly, but i have wxpython installed, and python is installed properly.

    Line 451 in <module> g.sessionData() name error 'g' is not defined.

    If you could, "I didnt read the licensing" would you add httplib2 to the same folder as the app and have its path hard coded? or have httplib2 installed through the app?

    Anywho thanks for offering to check out my problem.

  5. love the program, Ive been looking for one in python specifically, so very nice.

    So far in using it I've noticed:

    *only 1 search works, after downloading and going back to search it errors

    *the program doesnt create the download directory if it doesnt already exist.

    *it asks you to agree to the eula everytime you start it

    *it doesnt check to see if a song (or filename) exists before downloading

    *obviously theres no option to stream song in player instead of downloading yet

    *and it doesnt actually save the new filepath for next session

    most of these have to do with persistance ala cfg file

    Anywho, good work, cant wait to see how this evolves

×
×
  • Create New...