File: comment.py

package info (click to toggle)
python-lamson 1.0pre11-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 3,508 kB
  • ctags: 1,036
  • sloc: python: 5,772; xml: 177; makefile: 19
file content (15 lines) | stat: -rw-r--r-- 482 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from lamson import queue


def attach_headers(message, user_id, post_name, domain):
    """Headers are used later by the index.py handler to figure out where
    the message finally goes."""
    message['X-Post-Name'] = post_name
    message['X-Post-User-ID'] = user_id
    message['X-Post-Domain'] = domain


def defer_to_queue(message):
    index_q = queue.Queue("run/posts")  # use a diff queue?
    index_q.push(message)
    print "run/posts count after dever", index_q.count()