Beispiel #1
0
func Render(w io.Writer, m *libkb.Markup) {
	if m == nil {
		return
	}
	w = getWriter(w)
	doc, err := Q.NewDocumentFromReader(m.ToReader())
	if err != nil {
		GlobUI.Printf("Cannot render markup: %s\n", err)
		return
	}
	renderer := NewRenderer(w)
	renderer.RenderNodes(doc.Nodes)
}
Beispiel #2
0
func (p *Prove) doPrechecks(ctx *Context) (err error) {
	var w *libkb.Markup
	w, err = p.st.PreProofCheck(p.usernameNormalized)
	if w != nil {
		if uierr := ctx.ProveUI.OutputPrechecks(context.TODO(), keybase1.OutputPrechecksArg{Text: w.Export()}); uierr != nil {
			p.G().Log.Warning("prove ui OutputPrechecks call error: %s", uierr)
		}
	}
	return
}
Beispiel #3
0
func (p *Prove) promptPostedLoop(ctx *Context) (err error) {
	found := false
	for i := 0; ; i++ {
		var retry bool
		var status keybase1.ProofStatus
		var warn *libkb.Markup
		retry, err = ctx.ProveUI.OkToCheck(context.TODO(), keybase1.OkToCheckArg{
			Name:    p.st.DisplayName(p.usernameNormalized),
			Attempt: i,
		})
		if !retry || err != nil {
			break
		}
		found, status, err = libkb.CheckPosted(p.postRes.ID)
		if found || err != nil {
			break
		}
		warn, err = p.st.RecheckProofPosting(i, status, p.usernameNormalized)
		if warn != nil {
			uierr := ctx.ProveUI.DisplayRecheckWarning(context.TODO(), keybase1.DisplayRecheckWarningArg{
				Text: warn.Export(),
			})
			if uierr != nil {
				p.G().Log.Warning("prove ui DisplayRecheckWarning call error: %s", uierr)
			}
		}
		if err != nil {
			break
		}
	}
	if !found && err == nil {
		err = libkb.ProofNotYetAvailableError{}
	}

	return
}