def sync_design_docs(temp=None): dir = os.path.abspath(os.path.dirname(__file__)) for pillow in import_pillows(instantiate=False): if hasattr(pillow, 'indicator_class'): app_label = pillow.indicator_class._meta.app_label db = get_db(app_label) sync_docs.sync_design_docs(db, os.path.join(dir, "_design"), FLUFF, temp=temp)
def sync_design_docs(temp=None): dir = os.path.abspath(os.path.dirname(__file__)) for pillow in import_pillows(instantiate=False): if hasattr(pillow, 'indicator_class'): app_label = pillow.indicator_class._meta.app_label db = get_db(app_label) sync_docs.sync_design_docs(db, os.path.join(dir, "_design"), FLUFF, temp=temp)
def start_pillows(): #gevent patching: logging doesn't seem to work unless thread is not patched pillows = import_pillows() pool = Pool(len(pillows)) while True: for p in pillows: pool.spawn(p.run) pool.join() print "Pillows all joined and completed - restarting again"
def copy_designs(temp='tmp', delete=True): for pillow in import_pillows(instantiate=False): if hasattr(pillow, 'indicator_class'): app_label = pillow.indicator_class._meta.app_label db = get_db(app_label) sync_docs.copy_designs(db, FLUFF)
def test_import_pillows(self): pillows = import_pillows(instantiate=True) self.assertEquals(len(pillows), 1) self.assertFalse(isclass(pillows[0]))
def test_import_pillows_class_only(self): pillows = import_pillows(instantiate=False) self.assertEquals(len(pillows), 1) self.assertTrue(isclass(pillows[0]))
def copy_designs(temp='tmp', delete=True): for pillow in import_pillows(instantiate=False): if hasattr(pillow, 'indicator_class'): app_label = pillow.indicator_class._meta.app_label db = get_db(app_label) sync_docs.copy_designs(db, FLUFF)