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

All Samples(74)  |  Call(74)  |  Derive(0)  |  Import(0)

src/d/j/djedi-cms-1.0/djedi/admin/api.py   djedi-cms(Download)
        """
        uri = self.decode_uri(uri)
        node = cio.get(uri, lazy=False)
 
        if node.content is None:

src/d/j/djedi-cms-1.0/djedi/templatetags/djedi_tags.py   djedi-cms(Download)
    {% node 'page/title' default='Lorem ipsum' edit=True %}
    """
    node = cio.get(key, default=default or u'')
    return lambda _: render_node(node, edit=edit)
 
 
        # Get node for uri, lacks context variable lookup due to lazy loading.
        node = cio.get(uri, default)
 
        return cls(tokens, node, kwargs)

src/c/o/content-io-1.0.1/tests/test_api.py   content-io(Download)
    def test_get(self):
        node = cio.get('label/email', default=u'fallback')
        self.assertEqual(node.content, u'fallback')
        self.assertEqual(node.initial_uri, 'label/email')
        self.assertEqual(node.uri, 'i18n://sv-se@label/email.txt')
 
    def test_get_with_empty_default(self):
        node = cio.get('page/title', default=u'', lazy=False)
        self.assertEqual(node.content, u'')
        node = cio.get('page/body', default=None, lazy=False)
 
        # Testing same non existing uri's twice to assert cache handles None/"" default
        node = cio.get('page/title', default=u'', lazy=False)
        self.assertEqual(node.content, u'')
        node = cio.get('page/body', default=None, lazy=False)

src/c/o/content-io-HEAD/tests/test_api.py   content-io(Download)
    def test_get(self):
        node = cio.get('label/email', default=u'fallback')
        self.assertEqual(node.content, u'fallback')
        self.assertEqual(node.initial_uri, 'label/email')
        self.assertEqual(node.uri, 'i18n://sv-se@label/email.txt')
 
    def test_get_with_empty_default(self):
        node = cio.get('page/title', default=u'', lazy=False)
        self.assertEqual(node.content, u'')
        node = cio.get('page/body', default=None, lazy=False)
 
        # Testing same non existing uri's twice to assert cache handles None/"" default
        node = cio.get('page/title', default=u'', lazy=False)
        self.assertEqual(node.content, u'')
        node = cio.get('page/body', default=None, lazy=False)

src/d/j/djedi-cms-1.0/djedi/tests/test_rest.py   djedi-cms(Download)
        self.assertEqual(meta['message'], u'lundberg')
 
        node = cio.get(uri, lazy=False)
        self.assertIsNone(node.content)
        cio.publish(uri)
        node = cio.get(uri, lazy=False)
            storage.get('i18n://sv-se@page/title')
 
        node = cio.get('i18n://page/title', lazy=False)
        self.assertIsNone(node.content)
 

src/c/o/content-io-1.0.1/tests/test_app.py   content-io(Download)
 
            with cio.env(i18n='en-us'):
                node = cio.get('i18n://label/firstname', lazy=False)
                buffered_node = cio.get('i18n://label/email')
 
                def assert_new_thread_env():
                    self.assertTupleEqual(cio.env.i18n, ('sv-se',))
                    self.assertEqual(len(pipeline._buffer), 0)
                    self.assertEqual(len(pipeline.history), 0)
                    cio.get('i18n://label/surname', lazy=False)

src/c/o/content-io-1.0.1/tests/test_cache.py   content-io(Download)
 
        with self.assertCache(calls=2, misses=1, sets=1):
            node = cio.get('i18n://label/email', lazy=False)
 
        cached_node = cache.get('i18n://sv-se@label/email')
 
        with self.assertCache(calls=1, misses=0, hits=1):
            node = cio.get('i18n://label/email', lazy=False)
            self.assertEqual(node.uri, 'i18n://sv-se@label/email.txt#1')
 

src/c/o/content-io-HEAD/tests/test_app.py   content-io(Download)
 
            with cio.env(i18n='en-us'):
                node = cio.get('i18n://label/firstname', lazy=False)
                buffered_node = cio.get('i18n://label/email')
 
                def assert_new_thread_env():
                    self.assertTupleEqual(cio.env.i18n, ('sv-se',))
                    self.assertEqual(len(pipeline._buffer), 0)
                    self.assertEqual(len(pipeline.history), 0)
                    cio.get('i18n://label/surname', lazy=False)

src/c/o/content-io-HEAD/tests/test_cache.py   content-io(Download)
 
        with self.assertCache(calls=2, misses=1, sets=1):
            node = cio.get('i18n://label/email', lazy=False)
 
        cached_node = cache.get('i18n://sv-se@label/email')
 
        with self.assertCache(calls=1, misses=0, hits=1):
            node = cio.get('i18n://label/email', lazy=False)
            self.assertEqual(node.uri, 'i18n://sv-se@label/email.txt#1')
 

src/c/o/content-io-1.0.1/tests/test_plugins.py   content-io(Download)
        cio.publish(node.uri)
 
        node = cio.get('page/title')
        raw_content = storage.get(node.uri)
 

  1 | 2  Next