def METHOD_NAME(self, id, activity = None):
    logging.debug(">>")
    log = "Strava Upload: "
    gpx_file = "%s/gpx/%s.gpx" % (self.conf_dir, id)
    try:
        logging.debug("Getting user token")
        user_token = self.login_token();
        if user_token is not None:
            existing_id = self.find_upload(id)
            if existing_id is None:
                logging.debug("Uploading GPX: %s" % gpx_file)
                upload_id = self.upload(user_token, gpx_file)
                if upload_id > 0:
                    self.store_upload_id(id, upload_id)
                    log = log + "success (upload: %s)!" % upload_id
                else:
                    log = log + "failed to upload!"
            else:
                # already uploaded - get status
                log = "Record already uploaded."
                status = self.get_status(user_token, existing_id)
                if status:
                    url = '%s%s' % (ACTIVITY_URL, status)
                    logging.debug(url)
                    log = log + "\n\n%s" % url
                    webbrowser.open(url)
                else:
                    # don't know status yet, assume it is processing
                    log = log + " Processing... check again soon!"
    except (ValueError, KeyError) as e:
        log = log + ("JSON error: %s." % e)
    except ConfigError as e:
        log = log + ("config error: %s." % e)
    except Exception as e:
        log = "Unknown exception: %s." % e
    logging.debug(log)
    md = Gtk.MessageDialog(self.pytrainer_main.windowmain.window1, Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, log)
    md.set_title(_("Strava Upload"))
    md.set_modal(False)
    md.METHOD_NAME()
    md.destroy()
    logging.debug("<<")