From 1cde31c86d9423e9b7a7409c2ef2ba7c0500e47f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Sat, 25 Feb 2012 18:45:17 +0000 Subject: Massive merge --- examples/pygments_api/forms.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/pygments_api/forms.py') diff --git a/examples/pygments_api/forms.py b/examples/pygments_api/forms.py index 30a59a84..cc147740 100644 --- a/examples/pygments_api/forms.py +++ b/examples/pygments_api/forms.py @@ -6,6 +6,7 @@ from pygments.styles import get_all_styles 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. @@ -24,5 +25,3 @@ class PygmentsForm(forms.Form): initial='python') style = forms.ChoiceField(choices=STYLE_CHOICES, initial='friendly') - - -- cgit v1.2.3 From eea2aa04378d27d79e7aba12ce95c697148bd57e Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 29 Aug 2012 19:54:38 +0100 Subject: Remove examples (to be moved to a seperate project) --- examples/pygments_api/forms.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 examples/pygments_api/forms.py (limited to 'examples/pygments_api/forms.py') diff --git a/examples/pygments_api/forms.py b/examples/pygments_api/forms.py deleted file mode 100644 index cc147740..00000000 --- a/examples/pygments_api/forms.py +++ /dev/null @@ -1,27 +0,0 @@ -from django import forms - -from pygments.lexers import get_all_lexers -from pygments.styles import get_all_styles - -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, - 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') -- cgit v1.2.3