2014-04-05 10:52:29 -05:00
|
|
|
"""
|
|
|
|
markov/forms.py --- forms for manipulating markov data
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
from django.forms import Form, CharField, FileField, ModelChoiceField
|
|
|
|
|
|
|
|
from markov.models import MarkovContext
|
|
|
|
|
|
|
|
log = logging.getLogger('dr_botzo.markov')
|
|
|
|
|
|
|
|
|
|
|
|
class LogUploadForm(Form):
|
|
|
|
|
|
|
|
"""Accept a file upload that will be imported into Markov stuff."""
|
|
|
|
|
|
|
|
log_file = FileField(help_text="Weechat log format.")
|
|
|
|
context = ModelChoiceField(queryset=MarkovContext.objects.all())
|
2014-04-05 18:00:45 -05:00
|
|
|
ignore_nicks = CharField(help_text="Comma-separated list of nicks to ignore.",
|
|
|
|
required=False)
|
|
|
|
strip_prefixes = CharField(help_text="Space-separated list of line prefixes to strip.",
|
|
|
|
required=False)
|
2014-04-05 10:52:29 -05:00
|
|
|
|
2014-04-05 14:53:05 -05:00
|
|
|
|
|
|
|
class TeachLineForm(Form):
|
|
|
|
|
|
|
|
"""Accept a line that will be imported into Markov stuff."""
|
|
|
|
|
|
|
|
context = ModelChoiceField(queryset=MarkovContext.objects.all())
|
|
|
|
line = CharField()
|
2014-04-05 18:00:45 -05:00
|
|
|
strip_prefixes = CharField(help_text="Space-separated list of line prefixes to strip.",
|
|
|
|
required=False)
|
2014-04-05 14:53:05 -05:00
|
|
|
|
2014-04-05 10:52:29 -05:00
|
|
|
# vi:tabstop=4:expandtab:autoindent
|