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
>>> rm -rf '/srv/bet.yourlabs.org/main/var/test-tasks/*' && uwsgi --ini uwsgi.ini | |
[uWSGI] getting INI configuration from uwsgi.ini | |
*** Starting uWSGI 1.0-dev-1488 (32bit) on [Fri Sep 9 11:14:11 2011] *** | |
compiled with version: 4.6.0 20110513 (prerelease) on 09 September 2011 10:11:57 | |
detected binary path: /srv/bet.yourlabs.org/bet_env/bin/uwsgi | |
uWSGI running as root, you can use --uid/--gid/--chroot options | |
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** | |
your memory page size is 4096 bytes | |
spawned uWSGI http 1 (pid: 16796) | |
HTTP router/proxy bound on 0.0.0.0:7000 |
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
# context processor | |
def acknowledge(request): | |
if not request.user.is_authenticated(): | |
return {} | |
if 'acknowledge' in request.GET.keys(): | |
b = RedisBackend() | |
b.acknowledge(request.user, request.GET['acknowledge']) | |
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
import datetime | |
class BaseNotification(object): | |
def __init__(self, **kwargs): | |
for k, v in kwargs.items(): | |
setattr(self, k, v) | |
if 'timestamp' in kwargs.keys(): | |
self.sent_at = datetime.datetime.fromtimestamp(kwargs['timestamp']) |
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 datetime | |
class BaseNotification(object): | |
def to_dict(self, user, sent_at): | |
return { | |
'timestamp': datetime.time.mktime(sent_at.timetuple()), | |
} | |
def from_dict(self, data): | |
self.timestamp = data['timestamp'] |
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
self.b.emit(notifications.TextNotification( | |
text=u'%(follower)s follows %(followed)s', | |
follower=self.u2, followed=self.u3 | |
), | |
queues=[ | |
'friends_dropdown::' + self.u3.pk, | |
['feed::' + u.id for u in Subscription.objects.subscribers_of(self.u2)], | |
['user_detail_activities_tab::' + u.id for u in (self.u2, self.u3)] | |
'all_site_activities', | |
], |
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 RedisBackend(base.BaseBackend): | |
def __init__(self, prefix='subscription'): | |
self.prefix = prefix | |
@property | |
def redis(self): | |
if not hasattr(self, '_redis'): | |
self._redis = redis.Redis() | |
return self._redis | |
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
Exception in Tkinter callback | |
Traceback (most recent call last): | |
File "/usr/lib/python3.2/tkinter/__init__.py", line 1399, in __call__ | |
return self.func(*args) | |
File "steinitz.py", line 69, in <lambda> | |
'command':lambda :self.match.deiconify() | |
AttributeError: 'App' object has no attribute 'match' | |
Exception in Tkinter callback | |
Traceback (most recent call last): |
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
0928 2102 Topic for #calculus: Welcome to our relaxed calculus channel; if you have a question, ask and wait, and help will come. We talk about any subject. | <afat> | |
19 years old he was a hermit liking on the streets doing math. <afat> a math junky. | |
0928 2102 Topic set by joo ; Tue Sep 20 02:40:01 2011 | |
0928 2102 Irssi: #calculus: Total of 23 nicks ; 1 ops, 0 halfops, 0 voices, 22 normal | |
0928 2102 ChanServ| [#calculus] Worms Do Calculus To Find Meals Or Avoid Unpleasantness http://www.sciencedaily.com/releases/2008/07/080702132219.htm | |
0928 2102 Channel #calculus created Fri Jan 29 04:37:49 2010 | |
0928 2102 Irssi: Join to #calculus was synced in 1 secs | |
0928 2102 Tau| hello is_null. | |
0928 2103 Tau| i am playing a game now. | |
0928 2103 Tau| let me finish it then we can talk. |
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 select import select | |
import socket | |
import readline | |
# HACK - python doesn't include a binding to rl_callback_read_char | |
import readline | |
import ctypes | |
rl_lib = ctypes.cdll.LoadLibrary("libreadline.so") |
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 select import select | |
import socket | |
import readline | |
# HACK - python doesn't include a binding to rl_callback_read_char | |
import readline | |
import ctypes | |
rl_lib = ctypes.cdll.LoadLibrary("libreadline.so") |