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 functools import wraps | |
def temporary_setting(setting_name, value): | |
def decorator(func): | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
from django.conf import settings | |
# save and disable the setting | |
old_value = getattr(settings, setting_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 django.contrib.auth.models import User | |
from tastypie.test import ResourceTestCase | |
class Test(ResourceTestCase): | |
def test_patch(self): | |
user = User(username='username', email='test@test.com') | |
user.set_password('password') | |
user.save() |
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 Klass: | |
def foo(self): | |
print 'foo' | |
a = Klass() | |
a.foo() | |
_old_foo = Klass.foo |
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
protected function _initCache() | |
{ | |
$frontend = array( | |
'lifetime' => null, | |
'automatic_serialization' => true | |
); | |
$backend = array( | |
'host' => 'localhost', | |
'port' => 11211, |
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
Processing IssuesController#create to json (for 10.4.5.251 at 2012-08-08 14:42:17) [POST] | |
Parameters: {"_json"=>"issue%5Bproject_id%5D=lasso&issue%5Bsubject%5D=api+test+issue&issue%5Bdescription%5D=testing+from+localhost%3A8000", "format"=>"json", "controller"=>"issues", "action"=>"create"} | |
Setting Columns (1.3ms) SHOW FIELDS FROM `settings` | |
SQL (0.5ms) SELECT max(`settings`.updated_on) AS max_updated_on FROM `settings` | |
Setting Load (0.4ms) SELECT * FROM `settings` WHERE (`settings`.`name` = 'rest_api_enabled') LIMIT 1 | |
AnonymousUser Columns (1.3ms) SHOW FIELDS FROM `users` | |
AnonymousUser Load (0.3ms) SELECT * FROM `users` WHERE ( (`users`.`type` = 'AnonymousUser' ) ) LIMIT 1 | |
Setting Load (0.3ms) SELECT * FROM `settings` WHERE (`settings`.`name` = 'login_required') LIMIT 1 | |
Filter chain halted as [:find_project] rendered_or_redirected. | |
Completed in 30ms (View: 0, DB: 4) | 404 Not Found [http://dev.lasso.rochester.edu/issues.json] |
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
[Tue Jul 24 16:00:01 2012] [error] Traceback (most recent call last): | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 117, in get_response | |
[Tue Jul 24 16:00:01 2012] [error] response = middleware_method(request, e) | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response | |
[Tue Jul 24 16:00:01 2012] [error] response = callback(request, *callback_args, **callback_kwargs) | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py", line 366, in wrapper | |
[Tue Jul 24 16:00:01 2012] [error] return self.admin_site.admin_view(view)(*args, **kwargs) | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view | |
[Tue Jul 24 16:00:01 2012] [error] response = view_func(request, *args, **kwargs) | |
[Tue Jul 24 16:00:01 2012] [error] |
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
[Tue Jul 24 16:00:01 2012] [error] Traceback (most recent call last): | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python2.7/dist-packages/raven/contrib/django/models.py", line 172, in actually_do_stuff | |
[Tue Jul 24 16:00:01 2012] [error] get_client().capture('Exception', exc_info=exc_info, request=request) | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python2.7/dist-packages/raven/contrib/django/client.py", line 94, in capture | |
[Tue Jul 24 16:00:01 2012] [error] result = super(DjangoClient, self).capture(event_type, **kwargs) | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python2.7/dist-packages/raven/base.py", line 378, in capture | |
[Tue Jul 24 16:00:01 2012] [error] self.send(**data) | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python2.7/dist-packages/raven/contrib/django/client.py", line 114, in send | |
[Tue Jul 24 16:00:01 2012] [error] return super(DjangoClient, self).send(**kwargs) | |
[Tue Jul 24 16:00:01 2012] [error] File "/usr/local/lib/python |
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
expect fork | |
start on startup | |
exec sudo -u itslocal /srv/sentry/bin/sentry --config=/srv/sentry/sentry.conf.py start |
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
# if we get both or neither, no good | |
if not (bool(timeAssignment) ^ bool(dropTake)): | |
raise DropError('drop() takes either a ' + self.family.RecurringTimeAssignment.__name__ + ' or ' + self.family.DropTake.__name__ + ' as an argument but not both nor neither') | |
if timeAssignment and not type(timeAssignment) == self.family.RecurringTimeAssignment: | |
raise TypeError('timeAssignment must be a ' + self.family.RecurringTimeAssignment.__name__) | |
if dropTake and not type(dropTake) == self.family.DropTake: | |
raise TypeError('dropTake must be a '+ self.family.DropTake.__name__) |