Did I find the right examples for you? yes no

All Samples(11)  |  Call(6)  |  Derive(0)  |  Import(5)

        def get_all_pillows(instantiate=True):
    settings = import_settings()

    pillowtops = []
    if hasattr(settings, 'PILLOWTOPS'):
        for k, v in settings.PILLOWTOPS.items():
            for full_str in v:
                pillowtop_class = import_pillow_string(full_str, instantiate=instantiate)
                pillowtops.append(pillowtop_class)

    return pillowtops
        


src/c/o/commcare-hq-HEAD/corehq/apps/hqcase/management/commands/ptop_preindex.py   commcare-hq(Download)
from datetime import datetime
from optparse import make_option
from django.core.mail import mail_admins
from pillowtop import get_all_pillows
from corehq.pillows.user import add_demo_user_to_user_index
    def handle(self, *args, **options):
        runs = []
        pillow_classes = get_all_pillows(instantiate=False)
        aliased_classes = filter(lambda x: issubclass(x, AliasedElasticPillow),
                                 pillow_classes)

src/p/i/pillowtop-0.1.5/pillowtop/management/commands/ptop_reset_checkpoint.py   pillowtop(Download)
from optparse import make_option
from django.core.management.base import LabelCommand
import sys
from pillowtop import get_pillow_by_name, get_all_pillows
 
        if not labels:
            pillow_class_names = [pillow.__class__.__name__
                                  for pillow in get_all_pillows()]
            print ""
            print "\nNo pillow class defined, options are: %s\n" % ('\n\t'.join(pillow_class_names))

src/p/i/pillowtop-0.1.5/pillowtop/run_pillowtop.py   pillowtop(Download)
import sys
from pillowtop import get_all_pillows
import multiprocessing
 
def _do_run_pillow(pillow_class):
def start_pillows(pillows=None):
    """
    Actual runner for running pillow processes. Use this to run pillows.
    """
    run_pillows = pillows or get_all_pillows()

src/p/i/pillowtop-0.1.5/pillowtop/management/commands/ptop_es_manage.py   pillowtop(Download)
from pillowtop.listener import AliasedElasticPillow
from pillowtop.management.pillowstate import get_pillow_states
from pillowtop import get_all_pillows
 
 
        es = get_es()
 
        pillows = get_all_pillows()
        aliased_pillows = filter(lambda x: isinstance(x, AliasedElasticPillow), pillows)
 

src/p/i/pillowtop-0.1.5/pillowtop/tests.py   pillowtop(Download)
from unittest2 import TestCase
from pillowtop import get_all_pillows
from pillowtop.listener import BasicPillow
from inspect import isclass
 
    def test_import_pillows_class_only(self):
        pillows = get_all_pillows(instantiate=False)
        self.assertEquals(len(pillows), 1)
        self.assertTrue(isclass(pillows[0]))
 
    def test_import_pillows(self):
        pillows = get_all_pillows(instantiate=True)