def __init__(self, parent): wx.Frame.__init__(self, parent, title = 'SimplyFlickr', size = (600, 400)) splitter = wx.SplitterWindow(self, style = wx.SP_BORDER) self.localPanel = LocalPanel(splitter) self.flickrPanel = FlickrPanel(splitter, self.Callback_LoadFlickrPhotosets) splitter.SplitVertically(self.localPanel, self.flickrPanel) # authentication (succ, auth_url) = flickr.login() print (succ, auth_url) if not succ: if AuthDialog(self, auth_url).ShowModal() == wx.ID_OK: print flickr.auth() else: wx.MessageDialog(self, 'Failed to login', 'Error', wx.OK) self.Destroy() Publisher().subscribe(self.AddFlickrPhotoset, ('AddFlickrPhotoset')) splitter.SetSashPosition(self.GetClientSize()[0] / 2) splitter.SetMinimumPaneSize(100) #splitter.SetSashSize(5) self.SetSizeHints(300, 200) self.__ComposeStatusBar() self.Bind(wx.EVT_CLOSE, self.OnClose, self) self.Show()
fp = open(save_name,"w") json.dump(argument, fp, indent=4) fp.close() def formatDict(arg): format_final = { 'albums': arg } writeJSON(format_final) user_name = raw_input("Enter user name - ") login = flickr.login(user_name) token = login.get_usertokens() keys = login.get_appkeys() # Get user_id from login object user_id = login.get_userid() print "login User: "******" id: ", user_id print # Initialization of a photoset object set_obj = flickr.photosets(token, True, 'json', None) # Get all photosets under the same author set_obj.photosetList_byUserid(user_id)
fp = open(save_name, "w") json.dump(argument, fp, indent=4) fp.close() def formatDict(arg): format_final = {'albums': arg} writeJSON(format_final) if __name__ == '__main__': user_name = raw_input("Enter user name - ") login = flickr.login(user_name) token = login.get_usertokens() keys = login.get_appkeys() # Get user_id from login object user_id = login.get_userid() print "login User: "******" id: ", user_id print # Initialization of a photoset object set_obj = flickr.photosets(token, True, 'json', None) # Get all photosets under the same author set_obj.photosetList_byUserid(user_id)