Example #1
0
        def photo_created_cb(photo, photo_id, callback):
            logging.debug("Photo created: %s" % (photo_id))

            def comment_added_cb(photo, comment_id, callback):
                logging.debug("Comment created: %s" % (comment_id))

                def comments_downloaded_cb(photo, comments, callback):
                    logging.debug("%s comments for photo %s",
                                  len(comments), photo.fb_object_id)

                    for c in comments:
                        logging.debug("Comment from %s with message: %s",
                                      c["from"], c["message"])
                    callback()

                photo.connect('comments-downloaded',
                              comments_downloaded_cb,
                              callback)
                photo.refresh_comments()
                return False

            photo = FbPhoto(photo_id)
            photo.connect("comment-added", comment_added_cb, callback)
            photo.add_comment("this is a test")
            return False
Example #2
0
        def photo_created_cb(photo, photo_id, callback):
            logging.debug("Photo created: %s" % (photo_id))

            def comment_added_cb(photo, comment_id, callback):
                logging.debug("Comment created: %s" % (comment_id))
                callback()
                return False

            photo = FbPhoto(photo_id)
            photo.connect("comment-added", comment_added_cb, callback)
            photo.add_comment("this is a test")
            return False