Преглед на файлове

Tweak math; use ndash.

master
Ben Kurtovic преди 8 години
родител
ревизия
9ce9421bcf
променени са 3 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. +1
    -1
      templates/error.mako
  2. +1
    -1
      templates/index.mako
  3. +3
    -2
      tif/calc.py

+ 1
- 1
templates/error.mako Целия файл

@@ -1,4 +1,4 @@
<%include file="/support/header.mako" args="title='Error - TIF Calculator'"/>
<%include file="/support/header.mako" args="title='Error &ndash; TIF Calculator'"/>
<h2>Error!</h2>
<p>An error occurred. If it hasn't been reported (<a href="https://github.com/earwig/template-influence-factor/issues">try to check</a>), please <a href="https://github.com/earwig/template-influence-factor/issues/new">file an issue</a> or <a href="mailto:wikipedia.earwig@gmail.com">email me</a>. Include the following information:</p>
<div id="error">


+ 1
- 1
templates/index.mako Целия файл

@@ -24,7 +24,7 @@
<table>
<tr>
<td>TIF</td>
<td>${"{0:.2f}".format(result["tif"])}</td>
<td>${"{0:.2f}".format(result["tif"])} views/min</td>
</tr>
<tr>
<td>Transclusions</td>


+ 3
- 2
tif/calc.py Целия файл

@@ -64,13 +64,14 @@ def _get_avg_views(site, article):

if "items" not in res:
return None
return sum(item["views"] for item in res["items"]) / float(days)
total_views = sum(item["views"] for item in res["items"])
return total_views / (float(days) * 24 * 60)

def _update_views(cursor, site, title, ns):
cache_life = "7 DAY"
query1 = """SELECT tl_from, page_title
FROM {0}.templatelinks
LEFT JOIN page ON tl_from = page_id
LEFT JOIN {0}.page ON tl_from = page_id
LEFT JOIN cache ON tl_from = cache_id
WHERE tl_title = ? AND tl_namespace = ? AND tl_from_namespace = 0 AND
(cache_id IS NULL OR cache_time < DATE_SUB(NOW(), INTERVAL {1}))"""


Зареждане…
Отказ
Запис