Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
intracer committed Sep 22, 2023
1 parent 3749a61 commit f702e8b
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,37 @@ import scala.concurrent.Future

trait SinglePageQuery {

def whatTranscludesHere(namespaces: Set[Int] = Set.empty, continueParam: Option[(String, String)] = None): Future[Iterable[Page]]
def whatTranscludesHere(
namespaces: Set[Int] = Set.empty,
continueParam: Option[(String, String)] = None): Future[Iterable[Page]]

def categoryMembers(namespaces: Set[Int] = Set.empty, continueParam: Option[(String, String)] = None): Future[Iterable[Page]]
def categoryMembers(
namespaces: Set[Int] = Set.empty,
continueParam: Option[(String, String)] = None): Future[Iterable[Page]]

def revisions(namespaces: Set[Int] = Set.empty, props: Set[String] = Set.empty, continueParam: Option[(String, String)] = None): Future[Iterable[Page]]
def revisions(
namespaces: Set[Int] = Set.empty,
props: Set[String] = Set.empty,
continueParam: Option[(String, String)] = None): Future[Iterable[Page]]

def revisionsByGenerator(
generator: String, generatorPrefix: String,
namespaces: Set[Int] = Set.empty, props: Set[String] = Set.empty,
continueParam: Option[(String, String)] = None,
limit: String = "max",
titlePrefix: Option[String] = None): Future[Iterable[Page]]
generator: String,
generatorPrefix: String,
namespaces: Set[Int] = Set.empty,
props: Set[String] = Set.empty,
continueParam: Option[(String, String)] = None,
limit: String = "max",
titlePrefix: Option[String] = None): Future[Iterable[Page]]

def imageInfoByGenerator(
generator: String, generatorPrefix: String,
namespaces: Set[Int] = Set(),
props: Set[String] = Set("timestamp", "user", "size", "url" /*, "extmetadata"*/),
continueParam: Option[(String, String)] = None,
limit: String = "max",
titlePrefix: Option[String] = None): Future[Iterable[Page]]
generator: String,
generatorPrefix: String,
namespaces: Set[Int] = Set(),
props: Set[String] =
Set("timestamp", "user", "size", "url" /*, "extmetadata"*/ ),
continueParam: Option[(String, String)] = None,
limit: String = "max",
titlePrefix: Option[String] = None): Future[Iterable[Page]]

def edit(text: String,
summary: Option[String] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,59 @@ import org.rogach.scallop._

class StatParams(arguments: Seq[String]) extends ScallopConf(arguments) {
val years = opt[List[Int]]("year", 'y', "contest year.")
val startYear = opt[Int]("startyear", 's', "contest year.")
val campaign = opt[String]("campaign", 'c', "upload campaign, like wlm-ua.", required = true)
val startYear = opt[Int]("start-year", 's', "contest year.")
val campaign = opt[String]("campaign",
'c',
"upload campaign, like wlm-ua.",
required = true)
val regions = opt[List[String]]("region", 'r', "region code")
val exceptRegions = opt[List[String]](name = "exceptregions", descr = "except region codes")
val exceptRegions =
opt[List[String]](name = "except-regions", descr = "except region codes")
val cities = opt[List[String]](name = "cities", descr = "cities")
val exceptCities = opt[List[String]](name = "exceptcities", descr = "except cities")
val newObjectRating = opt[Double](name = "new-object-rating", descr = "new object rating")
val newAuthorObjectRating = opt[Double](name = "new-author-object-rating", descr = "new author object rating")
val numberOfAuthorsBonus = opt[Boolean](name = "number-of-authors-bonus", descr = "number of authors bonus")
val numberOfImagesBonus = opt[Boolean](name = "number-of-images-bonus", descr = "number of images bonus")
val exceptCities =
opt[List[String]](name = "except-cities", descr = "except cities")
val newObjectRating =
opt[Double](name = "new-object-rating", descr = "new object rating")
val newAuthorObjectRating = opt[Double](name = "new-author-object-rating",
descr = "new author object rating")
val numberOfAuthorsBonus = opt[Boolean](name = "number-of-authors-bonus",
descr = "number of authors bonus")
val numberOfImagesBonus = opt[Boolean](name = "number-of-images-bonus",
descr = "number of images bonus")
val baseRate = opt[Double](name = "base-rate", descr = "base rate")
val gallery = opt[Boolean](name = "gallery", descr = "gallery")
val fillLists = opt[Boolean](name = "fill-lists", descr = "fill lists")
val wrongIds = opt[Boolean](name = "wrong-ids", descr = "report wrong ids")
val missingIds = opt[Boolean](name = "missing-ids", descr = "report missing ids")
val multipleIds = opt[Boolean](name = "multiple-ids", descr = "report multiple ids")
val lowRes = opt[Boolean](name = "low-res", descr = "report low resolution photos")
val specialNominations = opt[Boolean](name = "special-nominations", descr = "report special nominations")
val regionalStat = opt[Boolean](name = "regional-stat", descr = "report regional statistics")
val regionalDetails = opt[Boolean](name = "regional-details", descr = "report regional detailed statistics")
val authorsStat = opt[Boolean](name = "authors-stat", descr = "report authors statistics")
val regionalGallery = opt[Boolean](name = "regional-gallery", descr = "report regional gallery")
val missingGallery = opt[Boolean](name = "missing-gallery", descr = "report missing galleries")
val placeDetection = opt[Boolean](name = "place-detection", descr = "report place detection")
val newMonuments = opt[Boolean](name = "new-monuments", descr = "new monuments")
val rateInputDistribution = opt[Boolean](name = "rate-input-distribution", descr = "rate input distribution")
val mostPopularMonuments = opt[Boolean](name = "most-popular-monuments", descr = "most popular monuments")
val missingIds =
opt[Boolean](name = "missing-ids", descr = "report missing ids")
val multipleIds =
opt[Boolean](name = "multiple-ids", descr = "report multiple ids")
val lowRes =
opt[Boolean](name = "low-res", descr = "report low resolution photos")
val specialNominations = opt[Boolean](name = "special-nominations",
descr = "report special nominations")
val regionalStat =
opt[Boolean](name = "regional-stat", descr = "report regional statistics")
val regionalDetails = opt[Boolean](name = "regional-details",
descr =
"report regional detailed statistics")
val authorsStat =
opt[Boolean](name = "authors-stat", descr = "report authors statistics")
val regionalGallery =
opt[Boolean](name = "regional-gallery", descr = "report regional gallery")
val missingGallery =
opt[Boolean](name = "missing-gallery", descr = "report missing galleries")
val placeDetection =
opt[Boolean](name = "place-detection", descr = "report place detection")
val newMonuments =
opt[Boolean](name = "new-monuments", descr = "new monuments")
val rateInputDistribution = opt[Boolean](name = "rate-input-distribution",
descr = "rate input distribution")
val mostPopularMonuments = opt[Boolean](name = "most-popular-monuments",
descr = "most popular monuments")
val minMpx = opt[Float](name = "min-mpx", descr = "minimum megapixels")
val previousYearsGallery = opt[Boolean](name = "prev-years-gallery", descr = "previous years gallery")
val previousYearsGallery =
opt[Boolean](name = "prev-years-gallery", descr = "previous years gallery")
verify()
}

Expand Down Expand Up @@ -104,4 +128,4 @@ object StatParams {
previousYearsGallery = conf.previousYearsGallery.getOrElse(false)
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ class MonumentDbStat {
val format = NumberFormat.getPercentInstance

val columns = Seq(
"country", "lang", "total", "name", "address", "coordinates", "image", "commonscat", "article"
"country",
"lang",
"total",
"name",
"address",
"coordinates",
"image",
"commonscat",
"article"
)

def getStat(monumentDbs: Seq[MonumentDB]) = {
Expand All @@ -32,7 +40,10 @@ class MonumentDbStat {
def withPercentage(value: Int) =
s"$value <small>(${format.format(value.toDouble / total.toDouble)})</small>"

Seq(country, lang, total.toString,
Seq(
country,
lang,
total.toString,
withPercentage(name),
withPercentage(address),
withPercentage(coordinates),
Expand All @@ -48,5 +59,3 @@ class MonumentDbStat {
}

}


0 comments on commit f702e8b

Please sign in to comment.