Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(3)  |  Derive(0)  |  Import(3)

src/n/o/notifier-HEAD/notifier/management/commands/forums_digest.py   notifier(Download)
 
from notifier.digest import render_digest, Digest, DigestCourse, DigestThread, DigestItem
from notifier.pull import generate_digest_content
from notifier.tasks import generate_and_send_digests
from notifier.user import get_digest_subscribers, get_user
    def show_content(self, users, from_dt, to_dt):
        all_content = generate_digest_content(
            [u['id'] for u in users], from_dt, to_dt)
        # use django's encoder; builtin one doesn't handle datetime objects
        json.dump(list(all_content), self.stdout, cls=DigestJSONEncoder)

src/n/o/notifier-HEAD/notifier/tasks.py   notifier(Download)
from notifier.connection_wrapper import get_connection
from notifier.digest import render_digest
from notifier.pull import generate_digest_content
from notifier.user import get_digest_subscribers, UserServiceException
 
    with closing(get_connection()) as cx:
        msgs = []
        for user_id, digest in generate_digest_content(users_by_id.keys(), from_dt, to_dt):
            user = users_by_id[user_id]
            # format the digest

src/n/o/notifier-HEAD/notifier/tests/test_pull.py   notifier(Download)
from notifier.digest import _trunc, THREAD_ITEM_MAXLEN, \
                            _get_thread_url, _get_course_title, _get_course_url
from notifier.pull import CommentsServiceException, Parser, generate_digest_content
 
 
        to_dt = datetime.datetime(2013, 1, 2)
        with patch('requests.post', return_value=Mock(status_code=200, json={})) as p:
            g = generate_digest_content(["a", "b", "c"], from_dt, to_dt)
            expected_api_url = '*test_cs_url*/api/v1/notifications'
            expected_headers = {