From 250ab0f609f32cd3e004e1f2711f9c2e4fd9b57c Mon Sep 17 00:00:00 2001 From: tom christie tom@tomchristie.com Date: Sun, 30 Jan 2011 11:00:20 +0000 Subject: Lots of docs, trying to tidy up examples... --- examples/pygments_api/forms.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'examples/pygments_api/forms.py') diff --git a/examples/pygments_api/forms.py b/examples/pygments_api/forms.py index dc9927e2..8488db06 100644 --- a/examples/pygments_api/forms.py +++ b/examples/pygments_api/forms.py @@ -3,23 +3,26 @@ from django import forms from pygments.lexers import get_all_lexers from pygments.styles import get_all_styles -import httplib2 as httplib - - LEXER_CHOICES = sorted([(item[1][0], item[0]) for item in get_all_lexers()]) STYLE_CHOICES = sorted((item, item) for item in list(get_all_styles())) - class PygmentsForm(forms.Form): """A simple form with some of the most important pygments settings. The code to be highlighted can be specified either in a text field, or by URL. We do some additional form validation to ensure clients see helpful error responses.""" - code = forms.CharField(widget=forms.Textarea, label='Code Text', max_length=1000000, + code = forms.CharField(widget=forms.Textarea, + label='Code Text', + max_length=1000000, help_text='(Copy and paste the code text here.)') - title = forms.CharField(required=False, help_text='(Optional)', max_length=100) - linenos = forms.BooleanField(label='Show Line Numbers', required=False) - lexer = forms.ChoiceField(choices=LEXER_CHOICES, initial='python') - style = forms.ChoiceField(choices=STYLE_CHOICES, initial='friendly') + title = forms.CharField(required=False, + help_text='(Optional)', + max_length=100) + linenos = forms.BooleanField(label='Show Line Numbers', + required=False) + lexer = forms.ChoiceField(choices=LEXER_CHOICES, + initial='python') + style = forms.ChoiceField(choices=STYLE_CHOICES, + initial='friendly') -- cgit v1.2.3