Skip to content

Install templates #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 130 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
8dd1c2e
"Just use distutils, as life is too short" -- lamby
Jan 15, 2012
936060b
Add a manage.py command for sending offline messages
mpasternak Jan 15, 2012
517b703
Re-format, PEP8, fix imports
May 4, 2013
d52fbfa
Re-format, PEP8, fix imports
May 4, 2013
a4d3d57
Add test_project and test_app (currently empty)
mpasternak May 4, 2013
cc465be
Checkpoint commit, got that working
mpasternak May 4, 2013
b28c4ea
Checkpoint commit
mpasternak May 5, 2013
4633448
Tests for storage
mpasternak May 5, 2013
039a255
Check
mpasternak May 5, 2013
b340a79
Checkpoint
mpasternak May 5, 2013
b587993
Updated README.md
mpasternak May 5, 2013
0150d05
Updated README.md
mpasternak May 5, 2013
d9730f1
Updated README.md
mpasternak May 5, 2013
c4b8f15
Updated README.md
mpasternak May 5, 2013
62bae73
Updated README.md
mpasternak May 5, 2013
66bc895
Updated README.md
mpasternak May 5, 2013
ae39f4a
Updated README.md
mpasternak May 5, 2013
75ebbdc
MSIE, Chrome, FFox WORK!!
mpasternak May 5, 2013
27782de
Check
mpasternak May 5, 2013
83678c7
Merge branch 'master' of github.com:mpasternak/django-monitio
mpasternak May 5, 2013
0299d66
Updated README.md
mpasternak May 5, 2013
1dbbd0b
Updated README.md
mpasternak May 5, 2013
8c1f864
Updated README.md
mpasternak May 5, 2013
a8215de
Remove redundant hosts
mpasternak May 8, 2013
2f83d57
Merge branch 'master' of github.com:mpasternak/django-monitio
mpasternak May 8, 2013
e5a8e1e
Some tests, working notifications
mpasternak May 9, 2013
3d63589
Some tests, working notifications
mpasternak May 9, 2013
3d26356
Improve message display
mpasternak May 9, 2013
f36e150
Test pass
mpasternak May 9, 2013
21ad1ac
Change create_message API a bit
mpasternak May 9, 2013
ae31473
Tests pass!
mpasternak May 9, 2013
eaa540c
Opera, MSIE, FF, Chrome WORK!
mpasternak May 9, 2013
6b3329d
Temporary
mpasternak May 10, 2013
c3c129f
Now we can run tests with Django's LiveTestCase, as tests bypass long…
mpasternak May 13, 2013
dac319f
MANIFEST.in
mpasternak May 13, 2013
968a61a
MANIFEST.in
mpasternak May 13, 2013
2dfab3a
Fixed imports, add a failing test for admin
mpasternak Jun 15, 2013
949472c
Update api, so SSE is *optional* and not default
mpasternak Jun 16, 2013
ad6b2ae
Fix admin bug when creating new entries
mpasternak Jun 16, 2013
69fa2df
Correct template installation
mpasternak Jun 19, 2013
79cb77e
Translation
mpasternak Jun 20, 2013
531a09c
Install yaffle library
mpasternak Jun 20, 2013
14d7bc1
Better!
mpasternak Jul 5, 2013
f383696
Better styling, allow HTML in messages (assume safe strings)
mpasternak Jul 5, 2013
6a11cd7
"Close message" on right
mpasternak Jul 5, 2013
610cec5
PEP-8
mpasternak Jul 10, 2013
1bd38cd
Add a new template tag, that marks as read all messages, which belong…
mpasternak Jul 10, 2013
54f827c
Test for bug in homepage
mpasternak Jul 11, 2013
f113200
Cool mark_as_read_by_url functionality with some tests and docs.
mpasternak Jul 11, 2013
4f425c3
Update db structure
mpasternak Jul 11, 2013
29b76de
Ignore chromedriver log
mpasternak Jul 11, 2013
29ebf12
Add 'url' parameter to the API
mpasternak Jul 12, 2013
d717cb1
FIXME
mpasternak Jul 12, 2013
8d7dee8
Fixing parameter 'email' typo
marcosalcazar Sep 18, 2013
553b335
Merge pull request #1 from marcosalcazar/master
mpasternak Sep 18, 2013
de51d68
Update requirements, fix typo
mpasternak Sep 27, 2013
64b4960
Add X-Accel-Buffering header for nginx
mpasternak Sep 27, 2013
64b6fd2
Fix function name
mpasternak Sep 29, 2013
a0caad2
Use a StreamingHttpResponse instead.
mpasternak Sep 29, 2013
82d9e98
How about this?
mpasternak Sep 29, 2013
8bc16ed
Update the hack for LINUX
mpasternak Sep 29, 2013
34c8db2
Even more buffer.
mpasternak Sep 29, 2013
ab9ed71
Let's try this way again
mpasternak Sep 30, 2013
8788326
Remove comment, as untrue.
mpasternak Sep 30, 2013
92f64b8
Try to fix the bug..
mpasternak Sep 30, 2013
888ff7c
Update latest eventsource.js polyfill from Yaffle
mpasternak Sep 30, 2013
faf4d91
Update to be compatbile with eventsource polyfill
mpasternak Sep 30, 2013
3abdac1
Comply with EventSource.js documentation
mpasternak Sep 30, 2013
fff0a7f
Add a snippet with working nginx configuration
mpasternak Oct 2, 2013
82b3a73
Update README.md
mpasternak Oct 2, 2013
63a7d91
Update README.md
mpasternak Oct 7, 2013
7f0ddaa
Remove old messages every 30 mins
mpasternak Oct 14, 2013
b3ffbe5
Bump version no
mpasternak Oct 14, 2013
649f5dc
Django 1.6
mpasternak Nov 22, 2013
ef24192
Better error message when Redis is missing
mpasternak Dec 12, 2013
311bd5a
Checkpoint commit
mpasternak Dec 12, 2013
798f402
Tests pass, welcome to the new monitio...
mpasternak Dec 13, 2013
7f45835
i18n
mpasternak Dec 13, 2013
8b41389
Foundation 5 theme support
mpasternak Dec 13, 2013
1bc6aa0
Updated README.md
mpasternak Dec 13, 2013
8f64e98
Updated README.md
mpasternak Dec 13, 2013
6d498ef
Updated README.md
mpasternak Dec 13, 2013
97c7f22
Remove no longer needed templates
mpasternak Dec 13, 2013
55968c9
Remove notes
mpasternak Dec 13, 2013
3f2b8a3
Remove unused code
mpasternak Dec 13, 2013
d39ab1a
0.3
mpasternak Dec 13, 2013
d5fa865
Remove unused URL
mpasternak Dec 14, 2013
b4780e4
Paren
Mar 17, 2014
f21ce87
Teporary TURN OFF SSE notifications, until I will find a proper solut…
mpasternak Mar 19, 2014
580225c
Version 0.4, don't notify automatically, SEE README
mpasternak Apr 2, 2014
2bafbea
Merge branch 'master' of github.com:mpasternak/django-monitio
mpasternak Apr 2, 2014
9d3c0f8
Return message
mpasternak Apr 2, 2014
25427c1
Do not AJAX-remove non-persistent messages
mpasternak Apr 2, 2014
d4de13b
Update nginx conf
mpasternak Apr 3, 2014
81f27cf
0.4.3
mpasternak Apr 3, 2014
fa8b3d2
Small js bug fix
mpasternak Apr 3, 2014
659f41b
0.4.5, better docs, offline initial messages
mpasternak Apr 4, 2014
aa83a1c
added required libraries for running the tests
luzfcb Apr 4, 2014
ddd6a81
added required OS programs for running the tests
luzfcb Apr 4, 2014
354941a
added .travis.yml file
luzfcb Apr 4, 2014
6e816d0
fixed wrong config on .travis.yml file
luzfcb Apr 4, 2014
5456fa2
possible fix to wrond config on travis.yml
luzfcb Apr 4, 2014
a9d445c
Revert "possible fix to wrond config on travis.yml"
luzfcb Apr 4, 2014
395dbfc
added execution permission to chromedriver binary file
luzfcb Apr 4, 2014
990b74f
add drone.io build_config sample
luzfcb Apr 4, 2014
24eff9a
another possible fix to chrome on travis
luzfcb Apr 4, 2014
0f86e30
another, another possible fix to chrome on travis
luzfcb Apr 4, 2014
85c37b3
added comments
luzfcb Apr 4, 2014
55469f8
add droneio_build.sh
luzfcb Apr 4, 2014
9530eba
added travis.org and drone.io badges
luzfcb Apr 4, 2014
1084905
Merge pull request #8 from luzfcb/add-travis
mpasternak Apr 6, 2014
10f627a
Bugxin
mpasternak Jun 1, 2014
57a0311
Merge branch 'master' of github.com:mpasternak/django-monitio
mpasternak Jun 1, 2014
1b89447
Fix AUTH_USER_MODEL
mpasternak Jul 7, 2014
fe7e3e0
Fix for Django 1.7
mpasternak Jul 9, 2014
20905fc
Run w/o chrome atm
mpasternak Oct 12, 2014
bb93fa6
Small fixes
mpasternak Oct 12, 2014
d711ea4
w/o chrome for a minute
mpasternak Oct 12, 2014
2261b1d
Travis fix
mpasternak Oct 12, 2014
c2cbf38
Travis fix
mpasternak Oct 12, 2014
d8eb5fd
Travis fix
mpasternak Oct 12, 2014
61ad650
Travis fix
mpasternak Oct 12, 2014
b804d66
Travis fix
mpasternak Oct 12, 2014
5e79265
Travis fix?
mpasternak Oct 12, 2014
34cb15c
Disable py3k for a moment
mpasternak Oct 12, 2014
9b6c070
Fix travis
mpasternak Oct 12, 2014
378625f
it's called noinput
mpasternak Oct 12, 2014
1e79f8c
Disable django 1.7 for a moment
mpasternak Oct 12, 2014
5cce92d
Update README.md
mpasternak Jun 4, 2015
67b4d6e
Update README.md
mpasternak Jun 4, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea/*
*.pyc
build/*
dist/*
django_monitio.egg-info/*
chromedriver.log
test_project/components
test_project/venv
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language:
python

python:
- "2.7"
# - "3.3"

env:
- DJANGO_VERSION=Django==1.6
# - DJANGO_VERSION=Django==1.7

before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- "sh -e install_OS_test_dependencies.sh"
- "export PATH=`pwd`:$PATH"

install:
- pip install $DJANGO_VERSION
- pip install -r test_project/requirements.txt

script:
- cd test_project
- python manage.py collectstatic --noinput
- python manage.py test
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include monitio
global-include *.js
global-include *.html
global-include *.mo
global-include *.po
prune test_app
prune test_project
8 changes: 8 additions & 0 deletions PLAN.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
** MSIE 10 does not work in... compatibility OR quirks mode, I have localized
version and have no idea, which is which :-)

** tests for dispatch(), sse and e-mail notifications

** tests for eventsource (currently disabled in tests, because it block devserver)

Better documentation
270 changes: 200 additions & 70 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions droneio_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pip install -r requirements_test.txt --use-mirrors
sudo start xvfb &
python manage.py test

41 changes: 41 additions & 0 deletions install_OS_test_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# ugly fix to chrome, chrome-driver on travis -
# see more info:
# https://github.com/travis-ci/travis-ci/issues/938
# based on: https://github.com/jsdevel/webdriver-sync/blob/master/.travis.yml
sudo apt-get remove chromium-browser
sudo apt-get install libappindicator1
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install ttf-mscorefonts-installer
sudo apt-get install x-ttcidfont-conf
sudo mkfontdir
sudo apt-get install defoma libgl1-mesa-dri xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo mkdir -p /usr/share/desktop-directories
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -f
sudo dpkg -i google-chrome-stable_current_amd64.deb
export CHROME_SANDBOX=/opt/google/chrome/chrome-sandbox
sudo rm -f $CHROME_SANDBOX
sudo wget https://googledrive.com/host/0B5VlNZ_Rvdw6NTJoZDBSVy1ZdkE -O $CHROME_SANDBOX
sudo chown root:root $CHROME_SANDBOX; sudo chmod 4755 $CHROME_SANDBOX
sudo md5sum $CHROME_SANDBOX
export DISPLAY=:99.0
Xvfb :99.0 -extension RANDR > /dev/null &
sudo chmod 1777 /dev/shm
export WEBDRIVER_SYNC_ENABLE_SELENIUM_STDOUT=true
export WEBDRIVER_SYNC_ENABLE_SELENIUM_STDERR=true
# end ugly fix to chrome, chrome-driver on travis

# echo "installing browsers..."
# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
# sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# sudo apt-get update
# sudo apt-get install google-chrome-stable firefox
# sudo apt-get install -f
# echo "downloading chromedriver..."
wget http://chromedriver.storage.googleapis.com/2.9/chromedriver_linux64.zip
unzip -o chromedriver_linux64.zip
echo "adding execution permission to chromedriver binary file"
chmod +x chromedriver
24 changes: 24 additions & 0 deletions monitio/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This must be imported first - the DEFAULT_TAGS must be updated
# before import of monitio.api
import constants
import notify
from django.contrib import messages

messages.DEFAULT_TAGS.update(constants.DEFAULT_TAGS)

from monitio.api import *















10 changes: 10 additions & 0 deletions monitio/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from monitio.models import Monit
from django.contrib import admin


class MessageAdmin(admin.ModelAdmin):
list_display = ['level', 'user', 'from_user', 'subject', 'message',
'created', 'read', 'is_persistent']


admin.site.register(Monit, MessageAdmin)
62 changes: 62 additions & 0 deletions monitio/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import constants

def add_message(request, level, message, extra_tags='', fail_silently=False,
subject='', user=None, email=False, sse=False, from_user=None,
expires=None, close_timeout=None, url=None):
return request._messages.add(level, message, extra_tags, subject, user,
from_user, expires, close_timeout,
sse, email, url)


def info(request, message, extra_tags='', fail_silently=False, subject='',
user=None, email=False, sse=False, from_user=None, expires=None,
close_timeout=None, url=None):
"""
"""
level = constants.INFO
return add_message(request, level, message, extra_tags, fail_silently,
subject, user, email, sse, from_user, expires,
close_timeout, url)


def warning(request, message, extra_tags='', fail_silently=False, subject='',
user=None, email=False, sse=False, from_user=None, expires=None,
close_timeout=None, url=None):
"""
"""
level = constants.WARNING
return add_message(request, level, message, extra_tags, fail_silently,
subject, user, email, sse, from_user, expires,
close_timeout, url)


def debug(request, message, extra_tags='', fail_silently=False, subject='',
user=None, email=False, sse=False, from_user=None, expires=None,
close_timeout=None, url=None):
"""
"""
level = constants.DEBUG
return add_message(request, level, message, extra_tags, fail_silently,
subject, user, email, sse, from_user, expires,
close_timeout, url)


def create_message(to_user, level, message, from_user=None, extra_tags='',
subject='', expires=None, close_timeout=None, sse=False,
email=False, url=None):
"""
Use this method to create message without a request object - this can
be used in command-line utilities, celery backend or for testing.
"""

from monitio.storage import PersistentMessageStorage
class request:
user = to_user
session = {}

request.messages = PersistentMessageStorage(request)

return request.messages.add(level=level, message=message, extra_tags=extra_tags,
subject=subject, from_user=from_user, expires=expires,
close_timeout=close_timeout, sse=sse, email=email,
url=url)
2 changes: 2 additions & 0 deletions monitio/conf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- encoding: utf-8 -*-

28 changes: 28 additions & 0 deletions monitio/conf/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- encoding: utf-8 -*-

#
# This package, django-monitio, needs to know, if we are runing the tests
# or not.
#
# This is pretty important, as by the time of this writing, LiveServerTestCase
# will block when testing monitio-enabled web pages, because sse view
# will block the server thread. So, let's set this value and give
# sse views a hint to behave differently.
#
# This is a new issue, I suppose, as there are no googleable rants about
# this limitation of LiveServerTestCase at this moment. Perhaps "one thread
# should be enough for everybody", just like 640k :-)
#

import sys

from django.conf import settings

TESTING = getattr(settings, 'TESTING', 'test' in sys.argv[:2])

if TESTING:
# This seems to be another problem. We should attach to this list
# every possible port of testserver.
settings.CORS_ORIGIN_WHITELIST = (
'localhost:8081'
)
File renamed without changes.
Binary file added monitio/locale/pl/LC_MESSAGES/django.mo
Binary file not shown.
49 changes: 49 additions & 0 deletions monitio/locale/pl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-13 22:31+0100\n"
"PO-Revision-Date: 2013-12-13 22:32+0100\n"
"Last-Translator: Michał Pasternak <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 1.6.2\n"
"Language: pl\n"

#: .\models.py:62
#, python-format
msgid "%(subject)s: %(message)s"
msgstr "%(subject)s: %(message)s"

#: .\views.py:109
msgid ""
"Cannot connect to Redis server. Please contact your system administrator. In "
"case you are the system administrator, please make sure, that the Redis "
"server is configured and running correctly."
msgstr ""
"Nie mogę połączyć się z serwerem Redis. Proszę, skontaktuj się ze swoim "
"administratorem systemu. Jeżeli to Ty jesteś administratorem systemu, "
"proszę, upewnij się, że serwer Redis jest skonfigurowany i funkcjonuje "
"poprawnie."

#: .\views.py:113
msgid "Redis server error"
msgstr "Błąd serwera Redis"

#: .\templates\monitio\message_li.html:20
#: .\templates\monitio\sse_template.html:13
msgid "close"
msgstr "zamknij"

#: .\templates\monitio\messages.html:22
msgid "close all messages"
msgstr "zamknij wszystkie komunikaty"
Binary file added monitio/locale/pl/LC_MESSAGES/djangojs.mo
Binary file not shown.
33 changes: 33 additions & 0 deletions monitio/locale/pl/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 1/0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-13 22:33+0100\n"
"PO-Revision-Date: 2013-12-13 22:32+0100\n"
"Last-Translator: Michał Pasternak <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 1.6.2\n"
"Language: pl\n"

#: .\static\monitio\js\themes\foundation.js:32
msgid "Close all: "
msgstr "Zamknij wszystkie: "

#: .\static\monitio\js\themes\foundation.js:33
#: .\static\monitio\js\themes\jqueryui.js:65
msgid "close all messages"
msgstr "zamknij wszystkie powiadomienia"

#: .\static\monitio\js\themes\jqueryui.js:32
msgid "<a>close</a>"
msgstr "<a>zamknij</a>"
File renamed without changes.
1 change: 1 addition & 0 deletions monitio/management/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
42 changes: 42 additions & 0 deletions monitio/management/commands/send_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import sys

from django.core.management.base import BaseCommand

from django.contrib import auth

User = auth.get_user_model()

from monitio import api


def err(msg, status=-1):
sys.stderr.write('%s: %s\n' % (sys.argv[0], msg))
sys.exit(status)


def get_user(username):
try:
return User.objects.get(username=username)
except User.DoesNotExist:
err("No such user: %r" % username)


class Command(BaseCommand):
args = 'from_user to_user message'
help = '''This tool creates a persistent message in the database.

Usage: send_message [from user] [to user] [level=INFO,ERROR,DEBUG...] [message]'''

def handle(self, *args, **options):
try:
from_user, to_user = [get_user(username) for username in args[:2]]
except ValueError:
err(self.help)

message = " ".join(args[3:])
level = getattr(api.constants, args[2])
api.create_message(level=level,
from_user=from_user, to_user=to_user,
message=message,
subject="%s message" % args[2],
sse=True)
27 changes: 27 additions & 0 deletions monitio/management/commands/sse_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- encoding: utf-8 -*-

from django.core.management import BaseCommand
from django.contrib.auth import get_user_model
from monitio import constants
from monitio.notify import sse
from monitio.views import SSE_ANONYMOUS


class Command(BaseCommand):
help = '''This utility lets you send dynamic notifications (via Redis)
to a logged-in OR anonymous user.

Uwage: sse_test [user]'''

def handle(self, *args, **options):
User = get_user_model()
try:
user = User.objects.get(username=args[0]).username
except (IndexError, User.DoesNotExist):
user = SSE_ANONYMOUS

print "Will send messages from ", user, "to", user
while True:
message = raw_input("message> ")
sse(constants.INFO, -1, message, "", "SSE message",
user, user)
Loading