Here is a good example: http://stackoverflow.com/questions/5761617/pyramid-authorization-for-stored-items/5761901#5761901
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 pymongo | |
from mongokit.database import Database | |
# code copied and adapted from mongokit (3-clause BSD license) | |
class CallableMixin(object): | |
""" | |
brings the callable method to a Document. usefull for the connection's | |
register method | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 collections | |
class OrderedDefaultDict(collections.OrderedDict, collections.defaultdict): | |
pass | |
odd = OrderedDefaultDict() | |
odd.default_factory = list |
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 os | |
from pyramid.config import Configurator | |
def main(global_config, **settings): | |
settings = {k: os.path.expandvars(v) for k, v in settings.items()} | |
config = Configurator(settings=settings) | |
config.include(__name__) | |
return config.make_wsgi_app() |
I hereby claim:
- I am merwok on github.
- I am merwok (https://keybase.io/merwok) on keybase.
- I have a public key whose fingerprint is B3B4 BE9F D83F 8A80 1450 9B13 D8F3 C537 2C03 6A62
To claim this, I am signing this object:
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 posixpath | |
from filebrowser.storage import StorageMixin | |
from storages.backends.s3boto3 import S3Boto3Storage | |
class S3Storage(StorageMixin, S3Boto3Storage): | |
"""Integration between filebrowser and S3 storage.""" | |
def isdir(self, 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
[app:main] | |
use = call:helloapp:main | |
pyramid.debug_notfound = true | |
pyramid.debug_routematch = true | |
pyramid.includes = | |
pyramid_debugtoolbar | |
[server:main] | |
use = egg:waitress#main |
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
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ... | |
Options (and corresponding environment variables): | |
-b : issue warnings about str(bytes_instance), str(bytearray_instance) | |
and comparing bytes/bytearray with str. (-bb: issue errors) | |
-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x | |
-c cmd : program passed in as string (terminates option list) | |
--check-hash-based-pycs always|default|never : | |
control how Python invalidates hash-based .pyc files | |
-d : turn on parser debugging output (for experts only, only works on | |
debug builds); also PYTHONDEBUG=x |