def __init__(self): def add_label(string): label = gtk.Label(string) self.window.vbox.pack_start(label, True, True, 0) label.show() self.window = gtk.Dialog() self.window.connect("destroy", self.destroy) add_label("User Name (email)") self.mail=gtk.Entry(max=25); self.window.vbox.pack_start(self.mail, True, True, 0) self.mail.show() add_label("Password") self.pwd=gtk.Entry(); self.pwd.set_visibility(False) self.window.vbox.pack_start(self.pwd, True, True, 0) self.pwd.show() self.window.set_border_width(10) buttonCancel = gtk.Button(stock="_Cancel") buttonCancel.connect("clicked",self.destroy,None) self.window.action_area.pack_start(buttonCancel, True, True, 0) buttonCancel.show() button = gtk.Button(stock="_OK") button.connect("clicked", self.save_and_quit, None) button.connect_object("clicked", gtk.Widget.destroy,self.window) self.window.action_area.pack_start(button, True, True, 0) try: print get_cc_details() __mail,__pwd,__hash,__id=get_cc_details() self.mail.set_text(__mail) self.pwd.set_text(__pwd) except Exception, e: print e
def __init__(self): rb.BrowserSource.__init__(self, name=_("My Music")) # catalogue stuff self.__db = None self.__saxHandler = None self.__activated = False self.__notify_id = 0 self.__update_id = 0 self.__info_screen = None self.__updating = False self.__load_current_size = 0 self.__load_total_size = 0 self.__db_load_finished = False mail,pwd,hash,id=get_cc_details() self.__mail=mail self.__pwd=pwd self.__hash=hash self.__id=id self.__catalogue_loader = None self.__catalogue_check = None def do_set_property(self, property, value): if property.name == 'plugin': self.__plugin = value else: raise AttributeError, 'unknown property %s' % property.name
def getAudioPage(self, page_path): url="http://vkontakte.ru/"+page_path; user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' mail,pwd,hash,id=get_cc_details() cookies="remixfriendsCommon=0; remixemail="+mail+"; remixchk=2; remixvideos=0; remixfriends=1; remixpass="******"; remixmid="+id+";" data="" headers = { 'User-Agent' : user_agent, "Cookie" : cookies } req = urllib2.Request(url, data, headers) response = urllib2.urlopen(req) the_page = response.read() info = response.info() charset = info['Content-Type'].split('charset=')[-1] result=unicode(the_page,charset) return result