3ab3206277c766565ec2f5419e3f51f04064212f angie Thu Feb 25 16:09:26 2021 -0800 Allow protobuf.tab's description column to contain filenames so we can point to automatically updated latest public files. diff --git src/hg/hgPhyloPlace/phyloPlace.c src/hg/hgPhyloPlace/phyloPlace.c index 5efe19e..c63468d 100644 --- src/hg/hgPhyloPlace/phyloPlace.c +++ src/hg/hgPhyloPlace/phyloPlace.c @@ -136,34 +136,45 @@ while (lineFileNextReal(lf, &line)) { char *words[5]; int wordCount = chopTabs(line, words); lineFileExpectWords(lf, 4, wordCount); if (treeChoices->count >= maxChoices) { warn("File %s has too many lines, only showing first %d phylogenetic tree choices", filename, maxChoices); break; } struct dyString *dy = dyStringNew(0); addPathIfNecessary(dy, db, words[0]); treeChoices->protobufFiles[treeChoices->count] = cloneString(dy->string); addPathIfNecessary(dy, db, words[1]); - treeChoices->metadataFiles[treeChoices->count] = dyStringCannibalize(&dy); + treeChoices->metadataFiles[treeChoices->count] = cloneString(dy->string); treeChoices->sources[treeChoices->count] = cloneString(words[2]); + // Description can be either a file or just some text. + addPathIfNecessary(dy, db, words[3]); + if (fileExists(dy->string)) + { + char *desc = NULL; + readInGulp(dy->string, &desc, NULL); + fprintf(stderr, "reading '%s' --> '%s'\n", dy->string, desc); + treeChoices->descriptions[treeChoices->count] = desc; + } + else treeChoices->descriptions[treeChoices->count] = cloneString(words[3]); treeChoices->count++; + dyStringFree(&dy); } lineFileClose(&lf); } return treeChoices; } static char *urlFromTn(struct tempName *tn) /* Make a full URL to a trash file that our net.c code will be able to follow, for when we can't * just leave it up to the user's web browser to do the right thing with "../". */ { struct dyString *dy = dyStringCreate("%s%s", hLocalHostCgiBinUrl(), tn->forHtml); return dyStringCannibalize(&dy); } void reportTiming(int *pStartTime, char *message)