• R/O
  • HTTP
  • SSH
  • HTTPS

shogi-server: コミット

shogi-server source


コミットメタ情報

リビジョン7a9b8f6315c13501a9936d89e66d93499c9e610b (tree)
日時2013-11-04 13:35:02
作者Daigo Moriwaki <beatles@user...>
コミッターDaigo Moriwaki

ログメッセージ

* [mk_rate] - Added a new option, --ignore, which is imported from mk_rate-from-grep.

変更サマリ

差分

--- a/changelog
+++ b/changelog
@@ -1,3 +1,9 @@
1+2013-11-04 Daigo Moriwaki <daigo at debian dot org>
2+
3+ * [mk_rate]
4+ - Added a new option, --ignore, which is imported from
5+ mk_rate-from-grep.
6+
17 2013-09-08 Daigo Moriwaki <daigo at debian dot org>
28
39 * [shogi-server]
--- a/mk_rate
+++ b/mk_rate
@@ -49,6 +49,10 @@
4949 # m [days] (default 7)
5050 # after m days, the half-life effect works
5151 #
52+# --ignore::
53+# m [days] (default 365*2)
54+# old results will be ignored
55+#
5256 # --fixed-rate-player::
5357 # player whose rate is fixed at the rate
5458 #
@@ -664,6 +668,11 @@ def parse(line)
664668 return if state == "abnormal"
665669 time = Time.parse(time)
666670 return if $options["base-date"] < time
671+ how_long_days = ($options["base-date"] - time)/(3600*24)
672+ if (how_long_days > $options["ignore"])
673+ return
674+ end
675+
667676 black_id = identify_id(black_id)
668677 white_id = identify_id(white_id)
669678
@@ -701,6 +710,8 @@ OPTOINS:
701710 --half-life n [days] (default 60)
702711 --half-life-ignore m [days] (default 7)
703712 after m days, half-life effect works
713+ --ignore n [days] (default 730 [=365*2]).
714+ Results older than n days from the 'base-date' are ignored.
704715 --fixed-rate-player player whose rate is fixed at the rate
705716 --fixed-rate rate
706717 --skip-draw-games skip draw games. [default: draw games are counted in
@@ -716,6 +727,7 @@ def main
716727 ["--half-life", GetoptLong::REQUIRED_ARGUMENT],
717728 ["--half-life-ignore", GetoptLong::REQUIRED_ARGUMENT],
718729 ["--help", "-h", GetoptLong::NO_ARGUMENT],
730+ ["--ignore", GetoptLong::REQUIRED_ARGUMENT],
719731 ["--fixed-rate-player", GetoptLong::REQUIRED_ARGUMENT],
720732 ["--fixed-rate", GetoptLong::REQUIRED_ARGUMENT],
721733 ["--skip-draw-games", GetoptLong::NO_ARGUMENT])
@@ -748,6 +760,8 @@ def main
748760 $options["half-life"] = $options["half-life"].to_i
749761 $options["half-life-ignore"] ||= 7
750762 $options["half-life-ignore"] = $options["half-life-ignore"].to_i
763+ $options["ignore"] ||= 365*2
764+ $options["ignore"] = $options["ignore"].to_i
751765 $options["fixed-rate"] = $options["fixed-rate"].to_i if $options["fixed-rate"]
752766
753767 if ARGV.empty?
旧リポジトリブラウザで表示