Permalink
Please sign in to comment.
Showing
with
109 additions
and 46 deletions.
- 0 bad_data.json
- +1 −0 config
- +0 −1 openlibrary/core/stats.py
- +4 −1 openlibrary/core/support.py
- +1 −1 openlibrary/core/task.py
- +14 −7 openlibrary/plugins/admin/support.py
- +1 −1 openlibrary/plugins/admin/tasks.py
- +48 −33 openlibrary/plugins/admin/templates/admin/cases.html
- +10 −2 openlibrary/plugins/openlibrary/support.py
- +30 −0 pump.py
No changes.
@@ -1,40 +1,55 @@ | ||
-$def with (cases) | ||
+$def with (cases, error = False) | ||
<div id="contentHead"> | ||
<h1>$_("Admin Center")</h1> | ||
- <div class="small"> | ||
- <a href="/admin/reload/">Reload Templates</a> | ||
- | <a href="/admin/block">Block IPs</a> | ||
- | <a href="/admin/loans">Loans</a> | ||
- | <a href="/admin/status">Services</a> | ||
- | <a href="/admin/support">Support</a> | ||
- </div> | ||
+ $:render_template("admin/menu", "/admin") | ||
</div> | ||
<div id="contentBody"> | ||
+<style type="text/css"> | ||
+table.support { | ||
+ font-family: Lucida, "Lucida Sans"; | ||
+ font-size: 0.75em; | ||
+ } | ||
-<h1>Help Cases</h1> | ||
-<p>Filter: 3,617 <strong>Total</strong> | 28 <a href="#filter for new">New</a> | 45 <a href="#filter by replied">Replied</a> | 3,546 <a href="#filter by closed">Closed</a></p> | ||
- | ||
-<table class = "support" border="0" cellspacing="0" cellpadding="10"> | ||
- <tr> | ||
- <th><a href="#SORT-BY">Created</a></th> | ||
- <th><a href="#SORT-BY">#</a></th> | ||
- <th><a href="#SORT-BY">Subject</a></th> | ||
- <th><a href="#SORT-BY">User</a></th> | ||
- <th><a href="#SORT-BY">Assigned to</a></th> | ||
+table.support th { | ||
+ font-weight: bold; | ||
+ } | ||
+table.support th, table.support td { | ||
+ border-bottom: 1px solid #ddd; | ||
+ vertical-align:top; | ||
+ padding: 5pt; | ||
+ } | ||
+table.support pre.hidden { | ||
+ display: none; | ||
+ } | ||
- <th><a href="#SORT-BY">Last Update</a></th> | ||
- <th><a href="#SORT-BY">Status</a></th> | ||
- </tr> | ||
- $for case in cases: | ||
- <tr> | ||
- <td>$datestr(case.created)</td> | ||
- <td>$case.caseid</td> | ||
- <td><a href="/admin/support/case/$(case.caseid)">$case.subject</a></td> | ||
- <td>$case.creator_name</td> | ||
- <td>$case.assignee</td> | ||
- <td>$datestr(case.last_modified)</td> | ||
- <td>$case.status</td> | ||
- </tr> | ||
-</table> | ||
-</div> | ||
+</style> | ||
+<h1>Help Cases</h1> | ||
+$if error: | ||
+ <p>Couldn't connect to support database</p> | ||
+$else: | ||
+ <p>Filter: 3,617 <strong>Total</strong> | 28 <a href="#filter for new">New</a> | 45 <a href="#filter by replied">Replied</a> | 3,546 <a href="#filter by closed">Closed</a></p> | ||
+ | ||
+ <table class = "support" border="0" cellspacing="0" cellpadding="10"> | ||
+ <tr> | ||
+ <th><a href="#SORT-BY">Created</a></th> | ||
+ <th><a href="#SORT-BY">#</a></th> | ||
+ <th><a href="#SORT-BY">Subject</a></th> | ||
+ <th><a href="#SORT-BY">User</a></th> | ||
+ <th><a href="#SORT-BY">Assigned to</a></th> | ||
+ | ||
+ <th><a href="#SORT-BY">Last Update</a></th> | ||
+ <th><a href="#SORT-BY">Status</a></th> | ||
+ </tr> | ||
+ $for case in cases: | ||
+ <tr> | ||
+ <td>$datestr(case.created)</td> | ||
+ <td>$case.caseid</td> | ||
+ <td><a href="/admin/support/case/$(case.caseid)">$case.subject</a></td> | ||
+ <td>$case.creator_name</td> | ||
+ <td>$case.assignee</td> | ||
+ <td>$datestr(case.last_modified)</td> | ||
+ <td>$case.status</td> | ||
+ </tr> | ||
+ </table> | ||
+ </div> |
@@ -0,0 +1,30 @@ | ||
+import time | ||
+from openlibrary.core.task import oltask | ||
+import logging | ||
+ | ||
+logger1 = logging.getLogger("Bunyan 1") | ||
+logger1.setLevel(logging.DEBUG) | ||
+h = logging.StreamHandler() | ||
+h.setLevel(logging.DEBUG) | ||
+f = logging.Formatter("%(levelname)s : %(filename)s : %(name)s : %(message)s") | ||
+h.setFormatter(f) | ||
+logger1.addHandler(h) | ||
+ | ||
+ | ||
+@oltask | ||
+def baz(a, b): | ||
+ time.sleep(10) | ||
+ logger1.debug("Hello") | ||
+ logger1.warn("Hello") | ||
+ logger1.critical("Dead") | ||
+ logger1.info("""All source code published here is available under the terms of the GNU Affero General Public License, version 3. Please see http://gplv3.fsf.org/ for more information.""") | ||
+ return a + b | ||
+ | ||
+ | ||
+ | ||
+for i in range(50): | ||
+ print "Hello", baz.delay(2, 2) | ||
+ | ||
+ | ||
+ | ||
+ |
0 comments on commit
ab82e18