Review Board 1.0.5.1

Simple IRC channel logging

Updated 9 months, 1 week ago

Andrew Schurman Reviewers
Basie-Dev
None Basie SVN
A simple supybot plugin to log all channel messages/events to the database. This does not include the bot itself. Some of it is boiler-plate supybot plugin which can safely be ignored. Some code adapted from DrProject.

This depends on the patch supplied by http://review.basieproject.org/r/410/ with additional message types.

Keep in mind that these tests don't integrate into our test framework. Rather our framework was added into the test. We should file integration into a new review.
Passing unit tests as well as verified working on a real IRC server.
Posted 10 months ago (September 28th, 2009, 5:46 p.m.)

   

  
Make this review simple by not worrying about a project just yet.
/trunk/supybot/BasieLogger/test.py (Diff revision 1)
 
I don't like being dependent on a specific backend, but it's appears the only way to disable repo creation after a new project created.
  1. nose_runner.setup_test_environment and nose_runner.teardown_test_environment (inside apps/django_nose) call functions that prepare the conditions to run basie tests. One of those funtions is vcs.tests.setup_test_environment: it avoids the creation of repositories at tests time.
  2. Your right. I only needed the line before because I wasn't using nose for testing. Once integrated with our environment, nose will do it's thing and this line is not needed.
/trunk/supybot/BasieLogger/test.py (Diff revision 1)
 
Standard django test code to setup the database.
Posted 10 months ago (September 28th, 2009, 5:53 p.m.)

   

  
/trunk/supybot/BasieLogger/test.py (Diff revision 1)
 
 
This will be extracted to a super class in the event of another plugin
Posted 10 months ago (September 29th, 2009, 10:19 a.m.)

   

  
import * is bad, import only modules that you'll actually need
Maybe 
proj = Project.objects.get(name=project)
Entry.objects.get(headline__exact="Man bites dog")

Not sure if case insensitive lookups are default in Django, but I found this: http://www.djangosnippets.org/snippets/305/
  1. Bah, sorry for the "Entry.objects.get(headline__exact="Man bites dog")", copy and paste problem.
Ditto
Review request changed
Updated 9 months, 3 weeks ago (October 7th, 2009, 4:54 p.m.)
  • A simple supybot plugin to log all channel messages/events to the database. This does not include the bot itself. Some of it is boiler-plate supybot plugin which can safely be ignored. Some code adapted from DrProject.
    
    This depends on the patch supplied by 410 with additional message types.
    
    Keep in mind that these tests don't integrate into our test framework. Rather our framework was added into the test. We should file integration into a new review.

    A simple supybot plugin to log all channel messages/events to the database. This does not include the bot itself. Some of it is boiler-plate supybot plugin which can safely be ignored. Some code adapted from DrProject.
    
    This depends on the patch supplied by http://review.basieproject.org/r/410/ with additional message types.
    
    Keep in mind that these tests don't integrate into our test framework. Rather our framework was added into the test. We should file integration into a new review.
Fix link to review 410.
Posted 9 months, 3 weeks ago (October 8th, 2009, 9:58 a.m.)

   

  
Django has built-in unicode support in django.utils.encoding

http://docs.djangoproject.com/en/dev/ref/unicode/
Posted 9 months, 3 weeks ago (October 8th, 2009, 1:56 p.m.)

   

  
/trunk/supybot/BasieLogger/test.py (Diff revision 2)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Hidden in http://review.basieproject.org/r/425/
Review request changed
Updated 9 months, 3 weeks ago (October 8th, 2009, 1:56 p.m.)
Updated diff.
Review request changed
Updated 9 months, 1 week ago (October 20th, 2009, 12:50 p.m.)
Review request changed
Updated 9 months, 1 week ago (October 20th, 2009, 12:54 p.m.)
Oops... Wrong review!
Review request changed
Updated 9 months, 1 week ago (October 20th, 2009, 10:59 p.m.)
Remove turning VCS off. This review now depends on http://review.basieproject.org/r/425/ .
Review request changed
Updated 9 months, 1 week ago (October 20th, 2009, 11:03 p.m.)
Missing 'r's from previous diff fixed.
Review request changed
Updated 9 months, 1 week ago (October 21st, 2009, 6:08 p.m.)
Moved from /trunk/supybot to /apps/ircbot/plugins. Although plugin modules don't follow all lowercase python convention, they do follow the supybot convention.
Posted 9 months, 1 week ago (October 21st, 2009, 8:58 p.m.)

   

  
Probably something like Project.objects.get(slug=chanel_name) in the future.
should be logged or should not be logged? I see == 0 both before an after the user quits.
Review request changed
Updated 9 months, 1 week ago (October 22nd, 2009, 12:25 p.m.)
Rewrite channel saving technique when we receive a user quit. Added more tests to accomodate extra (likely never to happen) cases.
Ship it!
Posted 9 months, 1 week ago (October 22nd, 2009, 1:21 p.m.)
Looks good. I will try again to run the other tests (more than two tests) after you commit, maybe is something in my working copy only.