Permalink
Browse files

Implement columns in search results to displaymore info

  • Loading branch information...
1 parent 654748d commit bddee8c2b2e9b36a81eb161bf19eb1127bce0cae @colder colder committed Aug 28, 2012
@@ -118,7 +118,16 @@ class ResultStore(val repl: ActorRef, val console: ActorRef, val settings: Setti
var i = 0
for (res <- results) {
val spc = if (i < 10) "" else " "
- console ! Info(spc+"["+i+"] "+res.entry.inlineString)
+
+ val colSourceCache = if (res.sources.contains("cache")) Console.YELLOW+"c"+Console.RESET else " "
+ val colSourceDBLP = if (res.sources.contains("dblp")) Console.YELLOW+"w"+Console.RESET else " "
+ val colSourceImported = if (res.sources.contains("managed")) Console.GREEN+"I"+Console.RESET else " "
+ val colSourceLoad = if (res.sources.contains("loaded")) Console.GREEN+"L"+Console.RESET else " "
+ val colInvalid = if (!res.entry.isValid) Console.RED+"!"+Console.RESET else " "
+
+ val extraCols = colSourceCache+colSourceDBLP+colSourceImported+colSourceLoad+colInvalid
+
+ console ! Info("["+i+spc+" "+extraCols+"] "+res.entry.inlineString)
i += 1
}
if (results.isEmpty) {
@@ -18,7 +18,7 @@ import json._
class SearchDBLP(val repl: ActorRef, val console: ActorRef, val settings: Settings) extends SearchModule {
val name = "Search DBLP"
- val source = "dblp "
+ val source = "dblp"
override def search(terms: List[String]): SearchResults = {
val results = try {

0 comments on commit bddee8c

Please sign in to comment.