Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Documented fields.py; changed HTML theme and capitalised Bendakai in …

…Sphinx configuration.
  • Loading branch information...
commit 2b24de2cf8e62fba9e06fa04d9c0687fe4ea9773 1 parent dd493f8
@kgodey authored
Showing with 24 additions and 6 deletions.
  1. +9 −6 docs/conf.py
  2. +15 −0 recipes/fields.py
View
15 docs/conf.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# bendakai documentation build configuration file, created by
+# Bendakai documentation build configuration file, created by
# sphinx-quickstart on Sat May 7 06:57:02 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
@@ -40,7 +40,7 @@
master_doc = 'index'
# General information about the project.
-project = u'bendakai'
+project = u'Bendakai'
copyright = u'2011, Kriti Godey'
# The version info for the project you're documenting, acts as replacement for
@@ -91,7 +91,10 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'default'
+html_theme = 'agogo'
+#html_theme_options = {
+# "headerbg": "true",
+#}
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -164,7 +167,7 @@
#html_file_suffix = None
# Output file base name for HTML help builder.
-htmlhelp_basename = 'bendakaidoc'
+htmlhelp_basename = 'Bendakaidoc'
# -- Options for LaTeX output --------------------------------------------------
@@ -178,7 +181,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- ('index', 'bendakai.tex', u'bendakai Documentation',
+ ('index', 'Bendakai.tex', u'Bendakai Documentation',
u'Kriti Godey', 'manual'),
]
@@ -211,7 +214,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'bendakai', u'bendakai Documentation',
+ ('index', 'Bendakai', u'Bendakai Documentation',
[u'Kriti Godey'], 1)
]
View
15 recipes/fields.py
@@ -3,10 +3,25 @@
import re
class FractionField(forms.RegexField):
+ """
+ A class that converts fractional input into floats for storage.
+
+ """
+
def __init__(self, *args, **kwargs):
super(FractionField, self).__init__(r'^((?:\d+\.?\d*/?\d*)(?: \d+/\d+)?)$', *args, **kwargs)
def to_python(self, value):
+ """
+ Coerces the fractional input into a float. Matches input in the set
+ [x, x/y, x y/z] where x, y, z are decimal numbers.
+
+ Keyword arguments:
+ self -- the FractionField instance on which this method is called.
+ value -- the value to be converted into a float.
+
+ """
+
if value == '':
return None
else:
Please sign in to comment.
Something went wrong with that request. Please try again.