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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<h4> | |
Shipping Information | |
</h4> | |
<p> |
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
>>> class Booltring(object): | |
... def __nonzero__(self): | |
... return False | |
... def __str__(self): | |
... return 'X' | |
... | |
>>> b = Booltring() | |
>>> bool(b) | |
False | |
>>> print b |
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
class UserContainer(ModelContainer): | |
__acl__ = [ | |
(Allow, 'admin', ('add', 'edit', 'delete')), | |
(Deny, Everyone, ALL_PERMISSIONS) | |
] | |
@view_config(renderer='users_browse.mako', context=UserContainer, permission='view') | |
def browse(request): | |
return dict() |
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
class UniqueEmailChange(formencode.FancyValidator): | |
def validate_python(self, values, c): | |
account = meta.Session.query(Account).filter_by(email=values['email']).first() | |
if account and values['profile_id'] not in [profile.id for profile in account.profiles]: | |
raise formencode.Invalid( | |
'That email address is already in use.', | |
values, c, error_dict=dict(email='That email address is already in use.')) | |
class EditProfileForm(formencode.Schema): | |
allow_extra_fields = True |
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.security import Allow, Deny | |
from pyramid.security import Authenticated, Everyone | |
from pyramid.security import ALL_PERMISSIONS | |
from pyramid.security import unauthenticated_userid | |
import ordereddict | |
from riotoustools.models import DBSession | |
from riotoustools.models.dayzero import DayZeroList | |
from riotoustools.models.dayzero import DayZeroItem |
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
@property | |
def __parent__(self): | |
class Root(object): | |
__name__ = None | |
__parent__ = None | |
class Item(object): | |
__name__ = 'dayzeroitem' | |
__parent__ = Root() | |
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 "/Users/wwitzel/code/riotoustools/tests/functional/test_default_views.py", line 7, in setUp | |
self.app = TestApp(main({}, **settings)) | |
File "/Users/wwitzel/code/riotoustools/riotoustools/__init__.py", line 39, in main | |
config.scan('riotoustools.models') | |
File "/Users/wwitzel/.envs/pyramid/lib/python2.6/site-packages/pyramid-1.0a10-py2.6.egg/pyramid/config.py", line 1804, in scan | |
scanner.scan(package, categories=categories) | |
File "/Users/wwitzel/.envs/pyramid/lib/python2.6/site-packages/venusian/__init__.py", line 40, in scan | |
invoke(name, ob) | |
File "/Users/wwitzel/.envs/pyramid/lib/python2.6/site-packages/venusian/__init__.py", line 33, in invoke |
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
(riotous)boi-mac-wwitzel:riotousbeta wayne.witzel$ blogofile build | |
ERROR:blogofile.post:Error reading post: _posts/001 - post 1.markdown | |
Traceback (most recent call last): | |
File "_controllers/blog/post.py", line 329, in parse_posts | |
bf.config.controllers.blog.post_encoding) | |
TypeError: decode() argument 1 must be string, not HierarchicalCache | |
Traceback (most recent call last): | |
File "/Users/wayne.witzel/.virtualenvs/riotous/bin/blogofile", line 8, in <module> | |
load_entry_point('Blogofile==1.0.0-DEV', 'console_scripts', 'blogofile')() | |
File "/Users/wayne.witzel/code/blogofile/blogofile/main.py", line 134, in 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
try: | |
image = y['image'] | |
image_fd = os.path.join(bf.config.blog.media_path, image) | |
from PIL import Image | |
pImage = Image.open(image_fd) | |
image_path = image.split(os.sep) | |
image_name = image_path[-1] | |
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
# Minus some boiler plate for validity and variable setup. | |
import os | |
import shutil | |
memory_file = request.POST['upload'] | |
disk_file = open(os.path.join(save_folder, save_name),'w') | |
shutil.copyfileobj(memory_file.file, disk_file) | |
disk_file.close() |
OlderNewer