This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyramid.config import Configurator | |
config = Configurator() | |
config.begin() | |
config.override_asset('framework', 'app:framework-overrides/') | |
config.commit() | |
config.add_translation_dirs('framework:locale') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def includeme(config): | |
config.add_translation_dirs('app:locale') | |
config.add_translation_dirs('app:framework-locale') | |
config.commit() | |
config.scan(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyramid.config import Configurator | |
if __name__ == '__main__': | |
config = Configurator() | |
config.override_asset('app', 'app.subapp:app-overrides/') | |
config.commit() | |
config.add_translation_dirs('app:locale') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(pyramid)[piotr@demon pyramid]$ nosetests -t test_xxx | |
E | |
====================================================================== | |
ERROR: test_xxx (pyramid.tests.test_config.test_i18n.TestI18NConfiguratorMixin) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/piotr/projects/pyramid/pyramid/tests/test_config/test_i18n.py", line 95, in test_xxx | |
dirs = config.registry.getUtility(ITranslationDirectories) | |
File "/home/piotr/.virtualenvs/pyramid/lib/python2.7/site-packages/zope/interface/registry.py", line 172, in getUtility | |
raise ComponentLookupError(provided, name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@fixture(scope='session') | |
def custom_settings(): | |
return {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_proxy(node, context): | |
name = title_to_name(node.name, blacklist=context.keys()) | |
if node.id is None: | |
DBSession.flush(objects=(node,)) | |
proxy = context[name] = ContentProxy(proxied_id=node.id) | |
return proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from requests import request | |
from requests import async | |
URL = 'http://httpbin.org/get' | |
def get(): | |
return request('get', URL) | |
def async_get(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User specific aliases and functions (.bashrc) | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
source /etc/bashrc | |
fi | |
# Source common definitions | |
if [ -f ~/.bashrc_common ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "/home/piotr/projects/kotti_content_proxy/kotti_content_proxy/tests/conftest.py", line 12, in foo_proxy | |
from kotti_content_proxy.resources import ContentProxy | |
File "/home/piotr/projects/kotti_content_proxy/kotti_content_proxy/__init__.py", line 10, in <module> | |
from .resources import ContentProxy | |
File "/home/piotr/projects/kotti_content_proxy/kotti_content_proxy/resources.py", line 14, in <module> | |
from kotti_content_proxy import _ | |
ImportError: cannot import name _ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on 2015-09-16 | |
:author: Piotr Dobrogost (email) | |
""" | |
from kotti.resources import File | |
from pyramid.i18n import TranslationStringFactory | |
from pyramid.view import view_config |