This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

New Features

    * Two new 404 aliens
    * enable a comment page cache if the user isn't author of any of the comments and the page is a non-permalink.  votes and friends are updated by javascript

    Additions
    * descriptive example.ini
    * create "trusted_sponsor" who get auto-accepted
    * split off url cache from the permacache, with major clean-up to app_globals
    * Move is_banned_domain() call into POST_submit() so it can take the sanitized url
    * Redirect /r/asdfasdfasdf to the search page, not the create page.
    * updates to draw_load.py
    * orangered envelope goes to unread, not all.
    * Remove "enable whitelisting" checkbox, and switch to new failiens
    * Put verification link on email prefs page

    Bugfixes:
    * split off a minimal api controller for onload calls (which don't care about c.site or c.user, making them cheaper)
    * Assume admins want to keep their cookies forever just like everyone else
    * /randomrising bugfix
    * JSON error page was rendering in html.  it now returns "{ error: ${code} }"
  • Loading branch information...
1 parent e87f520 commit e6838895e04fd683ea6477b2dba19e889681edb8 @jedberg jedberg committed with KeyserSosa May 17, 2010
Showing with 1,166 additions and 482 deletions.
  1. +23 −3 r2/draw_load.py
  2. +220 −113 r2/example.ini
  3. +25 −8 r2/r2/config/middleware.py
  4. +2 −0 r2/r2/config/routing.py
  5. +1 −0 r2/r2/controllers/__init__.py
  6. +61 −41 r2/r2/controllers/api.py
  7. +16 −6 r2/r2/controllers/error.py
  8. +8 −10 r2/r2/controllers/front.py
  9. +4 −3 r2/r2/controllers/listingcontroller.py
  10. +5 −3 r2/r2/controllers/promotecontroller.py
  11. +16 −12 r2/r2/controllers/reddit_base.py
  12. +0 −4 r2/r2/controllers/validator/validator.py
  13. +55 −46 r2/r2/lib/app_globals.py
  14. +5 −5 r2/r2/lib/cache.py
  15. +6 −30 r2/r2/lib/db/queries.py
  16. +6 −3 r2/r2/lib/db/sorts.py
  17. +50 −9 r2/r2/lib/db/thing.py
  18. +2 −1 r2/r2/lib/log.py
  19. +1 −1 r2/r2/lib/menus.py
  20. +23 −0 r2/r2/lib/migrate.py
  21. +171 −0 r2/r2/lib/mr_tools.py
  22. +136 −15 r2/r2/lib/pages/pages.py
  23. +14 −8 r2/r2/lib/pages/things.py
  24. +1 −1 r2/r2/lib/promote.py
  25. +5 −4 r2/r2/lib/strings.py
  26. +1 −1 r2/r2/lib/utils/__init__.py
  27. +1 −1 r2/r2/lib/utils/trial_utils.py
  28. +4 −5 r2/r2/lib/utils/utils.py
  29. +4 −0 r2/r2/models/account.py
  30. +5 −4 r2/r2/models/admintools.py
  31. +7 −6 r2/r2/models/builder.py
  32. +27 −18 r2/r2/models/link.py
  33. +27 −25 r2/r2/models/populatedb.py
  34. +12 −6 r2/r2/models/subreddit.py
  35. +18 −4 r2/r2/models/trial.py
  36. +3 −11 r2/r2/models/vote.py
  37. +1 −1 r2/r2/public/static/css/reddit.css
  38. +14 −9 r2/r2/public/static/js/jquery.reddit.js
  39. +19 −0 r2/r2/public/static/js/reddit.js
  40. BIN r2/r2/public/static/reddit404a.png
  41. BIN r2/r2/public/static/reddit404b.png
  42. BIN r2/r2/public/static/reddit404c.png
  43. +3 −0 r2/r2/public/static/robots.txt
  44. BIN r2/r2/public/static/youbrokeit.png
  45. BIN r2/r2/public/static/youbrokeit1.png
  46. BIN r2/r2/public/static/youbrokeit2.png
  47. BIN r2/r2/public/static/youbrokeit3.png
  48. +0 −1 r2/r2/templates/comment.html
  49. +2 −10 r2/r2/templates/createsubreddit.html
  50. +22 −11 r2/r2/templates/prefupdate.html
  51. +1 −5 r2/r2/templates/printable.html
  52. +1 −1 r2/r2/templates/printablebuttons.html
  53. +14 −1 r2/r2/templates/profiling.html
  54. +1 −1 r2/r2/templates/promotelinkform.html
  55. +6 −2 r2/r2/templates/redditheader.html
  56. +4 −4 r2/r2/templates/subreddit.html
  57. +3 −3 r2/r2/templates/subredditinfobar.html
  58. +16 −0 r2/r2/templates/thingupdater.html
  59. +21 −9 r2/r2/templates/userawards.html
  60. +10 −6 r2/r2/templates/usertableitem.html
  61. +4 −3 r2/r2/templates/wrappeduser.html
  62. +2 −2 r2/setup.py
  63. +35 −0 r2/updateini.py
  64. +22 −6 scripts/log_q.py
View
@@ -26,9 +26,9 @@ def draw_load(row_size = 12, width = 200, out_file = "/tmp/load.png"):
number = (len([x for x in hosts if x.services]) +
len([x for x in hosts if x.database]) +
- sum(len(x.queue.queues) for x in hosts if x.queue)) + 3
+ sum(len(x.queue.queues) for x in hosts if x.queue)) + 9
- im = Image.new("RGB", (width, number * row_size + 2))
+ im = Image.new("RGB", (width, number * row_size + 3))
draw = ImageDraw.Draw(im)
def draw_box(label, color, center = False):
ypos = draw_box.ypos
@@ -49,13 +49,33 @@ def draw_box(label, color, center = False):
draw_box(" ==== SERVICES ==== ", "#BBBBBB", center = True)
for host in hosts:
- if host.services:
+ if host.host.startswith('app'):
+ draw_box(" %s load: %s" % (host.host, host.load()),
+ get_load_level(host))
+
+ draw_box(" ==== BUTTONS ==== ", "#BBBBBB", center = True)
+ for host in hosts:
+ if host.host.startswith('button'):
+ draw_box(" %s load: %s" % (host.host, host.load()),
+ get_load_level(host))
+
+ draw_box(" ==== SEARCH ==== ", "#BBBBBB", center = True)
+ for host in hosts:
+ if host.host.startswith('search'):
+ draw_box(" %s load: %s" % (host.host, host.load()),
+ get_load_level(host))
+
+ draw_box(" ==== CACHES ==== ", "#BBBBBB", center = True)
+ for host in hosts:
+ if host.host.startswith('cache') or host.host.startswith('pmc'):
draw_box(" %s load: %s" % (host.host, host.load()),
get_load_level(host))
draw_box(" ==== QUEUES ==== ", "#BBBBBB", center = True)
for host in hosts:
if host.queue:
+ draw_box(" %s load: %s" % (host.host, host.load()),
+ get_load_level(host))
for name, data in host.queue:
max_len = host.queue.max_length(name)
draw_box(" %16s: %5s / %5s" % (name, data(), max_len),
Oops, something went wrong.

0 comments on commit e683889

Please sign in to comment.