You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(4) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(1) |
Feb
(8) |
Mar
(8) |
Apr
(4) |
May
(19) |
Jun
(1) |
Jul
(1) |
Aug
(18) |
Sep
(18) |
Oct
(19) |
Nov
(75) |
Dec
(80) |
| 2006 |
Jan
(86) |
Feb
(61) |
Mar
(60) |
Apr
(47) |
May
(39) |
Jun
(16) |
Jul
(30) |
Aug
(13) |
Sep
(13) |
Oct
(21) |
Nov
(1) |
Dec
(10) |
| 2007 |
Jan
(2) |
Feb
(7) |
Mar
(9) |
Apr
(3) |
May
(9) |
Jun
(4) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(12) |
Nov
(1) |
Dec
(7) |
| 2008 |
Jan
|
Feb
(2) |
Mar
(14) |
Apr
(9) |
May
(23) |
Jun
(4) |
Jul
|
Aug
(13) |
Sep
(8) |
Oct
(15) |
Nov
(40) |
Dec
(14) |
| 2009 |
Jan
|
Feb
(4) |
Mar
(10) |
Apr
(2) |
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sub...@co...> - 2005-09-22 15:58:09
|
Author: test Date: 2005-09-22 15:57:52 +0000 (Thu, 22 Sep 2005) New Revision: 1021 Added: FormEncode/tags/0.2.2/ Log: Tagging 0.2.2 version Copied: FormEncode/tags/0.2.2 (from rev 1020, FormEncode/trunk) |
|
From: <sub...@co...> - 2005-09-21 21:47:50
|
Author: test
Date: 2005-09-21 21:47:43 +0000 (Wed, 21 Sep 2005)
New Revision: 1019
Modified:
FormEncode/trunk/formencode/compound.py
FormEncode/trunk/formencode/declarative.py
FormEncode/trunk/formencode/formgen.py
FormEncode/trunk/formencode/htmlfill.py
FormEncode/trunk/formencode/htmlfill_schemabuilder.py
FormEncode/trunk/formencode/validators.py
Log:
Fixes suggested by pyflakes
Modified: FormEncode/trunk/formencode/compound.py
===================================================================
--- FormEncode/trunk/formencode/compound.py 2005-09-21 14:18:05 UTC (rev 1018)
+++ FormEncode/trunk/formencode/compound.py 2005-09-21 21:47:43 UTC (rev 1019)
@@ -1,4 +1,3 @@
-from declarative import DeclarativeMeta, Declarative
from api import *
# @@ ianb 2005-05: should CompoundValidator be included?
Modified: FormEncode/trunk/formencode/declarative.py
===================================================================
--- FormEncode/trunk/formencode/declarative.py 2005-09-21 14:18:05 UTC (rev 1018)
+++ FormEncode/trunk/formencode/declarative.py 2005-09-21 21:47:43 UTC (rev 1019)
@@ -22,10 +22,6 @@
import copy
import new
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
try:
import itertools
Modified: FormEncode/trunk/formencode/formgen.py
===================================================================
--- FormEncode/trunk/formencode/formgen.py 2005-09-21 14:18:05 UTC (rev 1018)
+++ FormEncode/trunk/formencode/formgen.py 2005-09-21 21:47:43 UTC (rev 1019)
@@ -26,16 +26,12 @@
It's not unreasonable to do a import * from this module.
"""
-import string, re, urllib, cgi
+import urllib
PILImage = None
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-import time, md5, whrandom, os
+import os
from htmlgen import html
True, False = (1==1), (0==1)
-from declarative import Declarative, DeclarativeMeta
+from declarative import Declarative
class NoDefault: pass
@@ -84,7 +80,7 @@
def description(self, obj):
if obj.description:
return obj.description
- return self.make_description(current_name)
+ return self.make_description(self.current_name)
def make_description(self, name):
return name
@@ -229,7 +225,7 @@
def __init__(self, *args, **kw):
Declarative.__init__(self, *args, **kw)
- def render(self, context):
+ def render(self, options):
assert self.action, "You must provide an action"
contents = html(
[f.render(options) for f in self.fields])
@@ -280,13 +276,13 @@
def wrap_fields(self, rendered_fields, options):
if not options.get('use_fieldset', self):
- return fields
+ return rendered_fields
legend = options.get('legend', self)
if legend:
legend = html.legend(legend)
else:
legend = ''
- return html.fieldset(legend, fields,
+ return html.fieldset(legend, rendered_fields,
class_=options.get('fieldset_class', self))
class TableLayout(Layout):
@@ -452,7 +448,7 @@
hidden = True
def html(self, options):
- return self.html_hidden(request)
+ return self.html_hidden(options)
zpt_html = html
@@ -600,7 +596,7 @@
for (value, desc) in selections]))
def zpt_html(self, options):
- return self.html(option, subsel=self.zpt_selection_html)
+ return self.html(options, subsel=self.zpt_selection_html)
def zpt_selection_html(self, selections, options):
name = options.name(self)
@@ -610,7 +606,8 @@
c=[html.option(desc,
value=value,
tal_attributes="selected python: %s == %r, 'selected')"
- % (options.zpt_value(self, in_python=True), value))]))
+ % (options.zpt_value(self, in_python=True), value))
+ for desc, value in self.selections]))
def selected(self, key, default):
if str(key) == str(default):
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2005-09-21 14:18:05 UTC (rev 1018)
+++ FormEncode/trunk/formencode/htmlfill.py 2005-09-21 21:47:43 UTC (rev 1019)
@@ -285,37 +285,6 @@
self.write_tag('option', attrs)
self.skip_next = True
- def update_schema(self, attrs):
- name = self.get_attr(attrs, "name")
- if not name:
- return
- v = compound.All()
- message = self.get_attr(attrs, "form:message")
- required = self.get_attr(attrs, "form:required", "no").lower()
- required = (required == "yes") or (required == "true")
- if required:
- v.validators.append(validators.NotEmpty(messages=get_messages(validators.NotEmpty, message)))
- t = self.get_attr(attrs, "form:validate", None)
- if t:
- # validatorname[:argument]
- i = t.find(":")
- if i > -1:
- args = t[i+1:] # TODO: split on commas?
- t = t[:i].lower()
- else:
- args = None
- t = t.lower()
- # get the validator class by name
- vclass = self.validators.get(t)
- if not vclass:
- raise ValueError, "Invalid validation type: " + t
- if args:
- vinst = vclass(args, messages=get_messages(vclass, message)) # TODO: if something takes more than 1 string argument, wrap in a function which parses args
- else:
- vinst = vclass(messages=get_messages(vclass, message))
- v.validators.append(vinst)
- self._schema.add_field(name, v)
-
def write_text(self, text):
self.content.append(text)
Modified: FormEncode/trunk/formencode/htmlfill_schemabuilder.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill_schemabuilder.py 2005-09-21 14:18:05 UTC (rev 1018)
+++ FormEncode/trunk/formencode/htmlfill_schemabuilder.py 2005-09-21 21:47:43 UTC (rev 1019)
@@ -36,19 +36,19 @@
name = get_attr(attrs, 'name')
if not name:
# @@: should warn if you try to validate unnamed fields
- return
- v = compound.All(validators.Identity())
- # for checkboxes, we must set if_missing = False
- if tag.lower() == "input":
- if get_attr(attrs, "type").lower() == "checkbox" or get_attr(attrs, "type").lower() == "submit":
+ return
+ v = compound.All(validators.Identity())
+ # for checkboxes, we must set if_missing = False
+ if tag.lower() == "input":
+ if get_attr(attrs, "type").lower() == "checkbox" or get_attr(attrs, "type").lower() == "submit":
v.validators.append(validators.Bool())
message = get_attr(attrs, 'form:message')
required = to_bool(get_attr(attrs, 'form:required', 'false'))
if required:
v.validators.append(
validators.NotEmpty(
- messages=get_messages(validators.NotEmpty, message)))
- else:
+ messages=get_messages(validators.NotEmpty, message)))
+ else:
v.validators[0].if_missing = False
v_type = get_attr(attrs, 'form:validate', None)
if v_type:
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2005-09-21 14:18:05 UTC (rev 1018)
+++ FormEncode/trunk/formencode/validators.py 2005-09-21 21:47:43 UTC (rev 1019)
@@ -24,14 +24,12 @@
"""
import re
-import cgi
DateTime = None
mxlookup = None
httplib = None
urlparse = None
from interfaces import *
from api import *
-from declarative import Declarative, DeclarativeMeta
True, False = (1==1), (0==1)
|
|
From: <sub...@co...> - 2005-09-13 15:25:34
|
Author: test
Date: 2005-09-13 15:25:24 +0000 (Tue, 13 Sep 2005)
New Revision: 986
Modified:
FormEncode/trunk/formencode/htmlfill.py
Log:
Also work property with <input type=button>
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2005-09-12 21:12:10 UTC (rev 985)
+++ FormEncode/trunk/formencode/htmlfill.py 2005-09-13 15:25:24 UTC (rev 986)
@@ -234,7 +234,7 @@
self.write_tag('input', attrs, startend)
self.skip_next = True
self.add_key(name)
- elif t == 'submit' or t == 'reset':
+ elif t == 'submit' or t == 'reset' or t == 'button':
self.set_attr(attrs, 'value', value or
self.get_attr(attrs, 'value', ''))
self.write_tag('input', attrs, startend)
|
|
From: <sub...@co...> - 2005-09-12 20:14:55
|
Author: test
Date: 2005-09-12 20:14:50 +0000 (Mon, 12 Sep 2005)
New Revision: 983
Modified:
FormEncode/trunk/setup.py
Log:
Updated version
Modified: FormEncode/trunk/setup.py
===================================================================
--- FormEncode/trunk/setup.py 2005-09-12 20:01:00 UTC (rev 982)
+++ FormEncode/trunk/setup.py 2005-09-12 20:14:50 UTC (rev 983)
@@ -3,7 +3,7 @@
from setuptools import setup
setup(name="FormEncode",
- version="0.2",
+ version="0.2.2",
description="HTML form validation, generation, and convertion package",
long_description="""\
FormEncode validates and converts nested structures. It allows for
|
|
From: <sub...@co...> - 2005-09-12 20:01:05
|
Author: test
Date: 2005-09-12 20:01:00 +0000 (Mon, 12 Sep 2005)
New Revision: 982
Modified:
FormEncode/trunk/examples/WebwareExamples/index.py
FormEncode/trunk/examples/webware_example.ini
Log:
Example with Webware servlets
Modified: FormEncode/trunk/examples/WebwareExamples/index.py
===================================================================
--- FormEncode/trunk/examples/WebwareExamples/index.py 2005-09-12 19:58:54 UTC (rev 981)
+++ FormEncode/trunk/examples/WebwareExamples/index.py 2005-09-12 20:01:00 UTC (rev 982)
@@ -1,13 +1,16 @@
from formencode.htmlform import HTMLForm
-from formencode.schema import Schema
-from formencode import validators
-from WebKit import Page
+from formencode import validators, compound, schema
+from WebKit.Page import Page
page_style = """
<html>
<head>
<title>Tell me about yourself</title>
+ <style type="text/css">
+ .error {background-color: #ffdddd}
+ .error-message {border: 2px solid #f00}
+ </style>
</head>
<body>
@@ -20,7 +23,7 @@
form_template = '''
<form action="" method="POST">
-<input type="hidden" name="_action" value="save">
+<input type="hidden" name="_action_" value="save">
Your name:<br>
<form:error name="name">
@@ -39,41 +42,53 @@
<input type="checkbox" value="black"> Black<br>
<input type="checkbox" value="green"> Green<br>
<br>
+
+<input type="submit" value="submit">
+</form>
'''
-class FormSchema(Schema):
- name = validators.StringCol(not_empty=True)
- age = validators.IntCol(min=13, max=99)
+class FormSchema(schema.Schema):
+ name = validators.String(not_empty=True)
+ age = validators.Int(min=13, max=99)
color = compound.All(validators.Set(),
- validators.OneOf(['red', 'blue', 'black', 'green']
+ validators.OneOf(['red', 'blue', 'black', 'green']))
+ filter_extra_fields = True
+ allow_extra_fields = True
-class webware_servlet(Page):
+class index(Page):
def awake(self, trans):
Page.awake(self, trans)
self.form = HTMLForm(form_template, FormSchema)
+ self.rendered_form = None
def actions(self):
return ['save']
- def defaultAction(self):
- # No form submitted
- self.rendered_form = self.form.render(
- defaults=self.getDefaults())
- self.showForm()
-
def save(self):
results, errors = self.form.validate(
self.request().fields(), self)
if results is not None:
self.doAction(results)
else:
+ print "Errors:", errors
self.rendered_form = self.form.render(
defaults=self.request().fields(),
errors=errors)
- self.showForm()
-
- def showForm(self):
+ self.writeHTML()
+
+ def writeContent(self):
+ if self.rendered_form is None:
+ self.rendered_form = self.form.render(
+ defaults=self.getDefaults())
self.write(page_style % self.rendered_form)
+ def getDefaults(self):
+ return dict(
+ age='enter your age',
+ color=['blue'])
+
+ def preAction(self, trans):
+ pass
+ postAction = preAction
Modified: FormEncode/trunk/examples/webware_example.ini
===================================================================
--- FormEncode/trunk/examples/webware_example.ini 2005-09-12 19:58:54 UTC (rev 981)
+++ FormEncode/trunk/examples/webware_example.ini 2005-09-12 20:01:00 UTC (rev 982)
@@ -1,8 +1,15 @@
+# To use this example install Paste: http://svn.pythonpaste.org
+# and run:
+# $ PYTHONPATH=path/to/examples paster serve webware_example.ini
+# and open:
+# http://localhost:9999/
+
[app:main]
use = egg:PasteWebKit
-publish_package = WebwareExamples
+servlet_directory = WebwareExamples
+debug = True
[server:main]
-use = egg:PythonScript#wsgiutils
+use = egg:PasteScript#wsgiutils
host = 127.0.0.1
port = 9999
|
|
From: <sub...@co...> - 2005-09-12 19:59:04
|
Author: test
Date: 2005-09-12 19:58:54 +0000 (Mon, 12 Sep 2005)
New Revision: 981
Modified:
FormEncode/trunk/formencode/htmlfill.py
Log:
Added handling of submit and reset buttons
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2005-09-12 18:11:08 UTC (rev 980)
+++ FormEncode/trunk/formencode/htmlfill.py 2005-09-12 19:58:54 UTC (rev 981)
@@ -55,6 +55,8 @@
self.in_select = None
self.skip_next = False
self.errors = errors or {}
+ if isinstance(self.errors, (str, unicode)):
+ self.errors = {None: self.errors}
self.in_error = None
self.skip_error = False
self.use_all_keys = use_all_keys
@@ -232,6 +234,12 @@
self.write_tag('input', attrs, startend)
self.skip_next = True
self.add_key(name)
+ elif t == 'submit' or t == 'reset':
+ self.set_attr(attrs, 'value', value or
+ self.get_attr(attrs, 'value', ''))
+ self.write_tag('input', attrs, startend)
+ self.skip_next = True
+ self.add_key(name)
else:
assert 0, "I don't know about this kind of <input>: %s (pos: %s)" \
% (t, self.getpos())
|
|
From: <sub...@co...> - 2005-09-12 18:11:45
|
Author: test Date: 2005-09-12 18:11:08 +0000 (Mon, 12 Sep 2005) New Revision: 980 Added: FormEncode/trunk/examples/WebwareExamples/ FormEncode/trunk/examples/WebwareExamples/__init__.py FormEncode/trunk/examples/WebwareExamples/index.py FormEncode/trunk/examples/webware_example.ini Log: Rearranged Added: FormEncode/trunk/examples/WebwareExamples/__init__.py =================================================================== --- FormEncode/trunk/examples/WebwareExamples/__init__.py 2005-09-12 18:09:59 UTC (rev 979) +++ FormEncode/trunk/examples/WebwareExamples/__init__.py 2005-09-12 18:11:08 UTC (rev 980) @@ -0,0 +1 @@ +# Added: FormEncode/trunk/examples/WebwareExamples/index.py =================================================================== --- FormEncode/trunk/examples/WebwareExamples/index.py 2005-09-12 18:09:59 UTC (rev 979) +++ FormEncode/trunk/examples/WebwareExamples/index.py 2005-09-12 18:11:08 UTC (rev 980) @@ -0,0 +1,79 @@ +from formencode.htmlform import HTMLForm +from formencode.schema import Schema +from formencode import validators +from WebKit import Page + + +page_style = """ +<html> + <head> + <title>Tell me about yourself</title> + </head> + <body> + + <h1>Tell me about yourself</h1> + <p><i>A FormEncode example</i></p> + + %s + + </body></html>""" + +form_template = ''' +<form action="" method="POST"> +<input type="hidden" name="_action" value="save"> + +Your name:<br> +<form:error name="name"> +<input type="text" name="name"> +<br> + +Your age:<br> +<form:error name="age"> +<input type="text" name="age"> +<br> + +Your favorite color:<br> +<form:error name="color"> +<input type="checkbox" value="red"> Red<br> +<input type="checkbox" value="blue"> Blue<br> +<input type="checkbox" value="black"> Black<br> +<input type="checkbox" value="green"> Green<br> +<br> +''' + +class FormSchema(Schema): + name = validators.StringCol(not_empty=True) + age = validators.IntCol(min=13, max=99) + color = compound.All(validators.Set(), + validators.OneOf(['red', 'blue', 'black', 'green'] + + +class webware_servlet(Page): + + def awake(self, trans): + Page.awake(self, trans) + self.form = HTMLForm(form_template, FormSchema) + + def actions(self): + return ['save'] + + def defaultAction(self): + # No form submitted + self.rendered_form = self.form.render( + defaults=self.getDefaults()) + self.showForm() + + def save(self): + results, errors = self.form.validate( + self.request().fields(), self) + if results is not None: + self.doAction(results) + else: + self.rendered_form = self.form.render( + defaults=self.request().fields(), + errors=errors) + self.showForm() + + def showForm(self): + self.write(page_style % self.rendered_form) + Added: FormEncode/trunk/examples/webware_example.ini =================================================================== --- FormEncode/trunk/examples/webware_example.ini 2005-09-12 18:09:59 UTC (rev 979) +++ FormEncode/trunk/examples/webware_example.ini 2005-09-12 18:11:08 UTC (rev 980) @@ -0,0 +1,8 @@ +[app:main] +use = egg:PasteWebKit +publish_package = WebwareExamples + +[server:main] +use = egg:PythonScript#wsgiutils +host = 127.0.0.1 +port = 9999 |
|
From: <sub...@co...> - 2005-09-12 18:10:08
|
Author: test Date: 2005-09-12 18:09:59 +0000 (Mon, 12 Sep 2005) New Revision: 979 Added: FormEncode/trunk/examples/ Log: Started some examples |
|
From: <sub...@co...> - 2005-09-11 05:23:32
|
Author: phunt
Date: 2005-09-11 05:23:27 +0000 (Sun, 11 Sep 2005)
New Revision: 977
Modified:
FormEncode/trunk/formencode/htmlfill.py
Log:
fixed a bug where we would fill in submit buttons with their submitted values (silly)
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2005-09-11 05:13:19 UTC (rev 976)
+++ FormEncode/trunk/formencode/htmlfill.py 2005-09-11 05:23:27 UTC (rev 977)
@@ -191,7 +191,7 @@
if (self.error_class
and self.errors.get(self.get_attr(attrs, 'name'))):
self.add_class(attrs, self.error_class)
- if t in ('text', 'hidden', 'submit', 'reset', 'button'):
+ if t in ('text', 'hidden'):
if value is None:
value = self.get_attr(attrs, 'value', '')
self.set_attr(attrs, 'value', value)
|
|
From: <sub...@co...> - 2005-09-11 05:13:27
|
Author: phunt
Date: 2005-09-11 05:13:19 +0000 (Sun, 11 Sep 2005)
New Revision: 976
Modified:
FormEncode/trunk/formencode/htmlfill_schemabuilder.py
Log:
fixed up missing value bugs
Modified: FormEncode/trunk/formencode/htmlfill_schemabuilder.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill_schemabuilder.py 2005-09-08 19:32:07 UTC (rev 975)
+++ FormEncode/trunk/formencode/htmlfill_schemabuilder.py 2005-09-11 05:13:19 UTC (rev 976)
@@ -37,17 +37,19 @@
if not name:
# @@: should warn if you try to validate unnamed fields
return
- v = compound.All()
+ v = compound.All(validators.Identity())
# for checkboxes, we must set if_missing = False
if tag.lower() == "input":
- if get_attr(attrs, "type").lower() == "checkbox":
+ if get_attr(attrs, "type").lower() == "checkbox" or get_attr(attrs, "type").lower() == "submit":
v.validators.append(validators.Bool())
message = get_attr(attrs, 'form:message')
required = to_bool(get_attr(attrs, 'form:required', 'false'))
if required:
v.validators.append(
validators.NotEmpty(
- messages=get_messages(validators.NotEmpty, message)))
+ messages=get_messages(validators.NotEmpty, message)))
+ else:
+ v.validators[0].if_missing = False
v_type = get_attr(attrs, 'form:validate', None)
if v_type:
pos = v_type.find(':')
|
|
From: <sub...@co...> - 2005-09-08 19:32:18
|
Author: test
Date: 2005-09-08 19:32:07 +0000 (Thu, 08 Sep 2005)
New Revision: 975
Modified:
FormEncode/trunk/formencode/validators.py
Log:
Fixed bug with None values and len(), submitted by Ksenia Marasanova
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2005-09-07 21:07:18 UTC (rev 974)
+++ FormEncode/trunk/formencode/validators.py 2005-09-08 19:32:07 UTC (rev 975)
@@ -839,11 +839,13 @@
}
def validate_python(self, value, state):
- if self.max is not None and len(value) > self.max:
+ if (self.max is not None and value is not None
+ and len(value) > self.max):
raise Invalid(self.message('tooLong', state,
max=self.max),
value, state)
- if self.min is not None and len(value) < self.min:
+ if (self.min is not None
+ and (not value or len(value) < self.min)):
raise Invalid(self.message('tooShort', state,
min=self.min),
value, state)
@@ -1054,7 +1056,7 @@
raise Invalid(
self.message('empty', state),
value, state)
- if len(value) != 2:
+ if not value or len(value) != 2:
raise Invalid(
self.message('wrongLength', state),
value, state)
|
|
From: <sub...@co...> - 2005-09-02 15:53:57
|
Author: ianb
Date: 2005-09-02 15:53:50 +0000 (Fri, 02 Sep 2005)
New Revision: 970
Modified:
FormEncode/trunk/formencode/validators.py
Log:
An empty tuple is an appropriate value in the case of a Set when nothing is submitted
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2005-09-01 16:24:50 UTC (rev 969)
+++ FormEncode/trunk/formencode/validators.py 2005-09-02 15:53:50 UTC (rev 970)
@@ -864,6 +864,8 @@
ForEach(convertToList=True).
"""
+ if_empty = ()
+
def _to_python(self, value, state):
if isinstance(value, (list, tuple)):
return value
|
|
From: <sub...@co...> - 2005-08-29 01:53:25
|
Author: ianb
Date: 2005-08-29 01:53:15 +0000 (Mon, 29 Aug 2005)
New Revision: 965
Modified:
FormEncode/trunk/formencode/schema.py
Log:
Removed some uses of the now-gone from_python() function
Modified: FormEncode/trunk/formencode/schema.py
===================================================================
--- FormEncode/trunk/formencode/schema.py 2005-08-28 07:57:01 UTC (rev 964)
+++ FormEncode/trunk/formencode/schema.py 2005-08-29 01:53:15 UTC (rev 965)
@@ -178,8 +178,7 @@
new[name] = value
else:
try:
- new[name] = from_python(self.fields[name],
- value, state)
+ new[name] = self.fields[name].from_python(value, state)
except Invalid, e:
errors[name] = e
@@ -202,7 +201,7 @@
pre.reverse()
for validator in pre:
__traceback_info__ = 'for_python pre_validator %s' % validator
- new = from_python(validator, new, state)
+ new = validator.from_python(new, state)
return new
|
|
From: <sub...@co...> - 2005-08-27 18:46:53
|
Author: ianb
Date: 2005-08-27 18:46:45 +0000 (Sat, 27 Aug 2005)
New Revision: 961
Modified:
FormEncode/trunk/formencode/validators.py
Log:
little Date bug
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2005-08-27 09:40:02 UTC (rev 960)
+++ FormEncode/trunk/formencode/validators.py 2005-08-27 18:46:45 UTC (rev 961)
@@ -73,7 +73,7 @@
def datetime_makedate(module, year, month, day):
if module.__name__ == 'datetime':
- return module.datetime.date(year, month, day)
+ return module.date(year, month, day)
else:
try:
return module.DateTime(year, month, day)
|
|
From: <sub...@co...> - 2005-08-24 17:15:16
|
Author: phd
Date: 2005-08-24 17:15:06 +0000 (Wed, 24 Aug 2005)
New Revision: 939
Modified:
FormEncode/trunk/formencode/compound.py
Log:
A small fix to make it compatible with Python 2.2.
Modified: FormEncode/trunk/formencode/compound.py
===================================================================
--- FormEncode/trunk/formencode/compound.py 2005-08-24 16:58:15 UTC (rev 938)
+++ FormEncode/trunk/formencode/compound.py 2005-08-24 17:15:06 UTC (rev 939)
@@ -96,7 +96,8 @@
# To preserve the order of the transformations, we do them
# differently when we are converting to and from python.
if validate is to_python:
- validators = self.validators[::-1]
+ validators = list(self.validators)
+ validators.reverse()
else:
validators = self.validators
try:
|
|
From: <sub...@co...> - 2005-08-24 16:58:29
|
Author: test Date: 2005-08-24 16:58:15 +0000 (Wed, 24 Aug 2005) New Revision: 938 Modified: FormEncode/trunk/formencode/htmlgen.py Log: Python 2.2 compat Modified: FormEncode/trunk/formencode/htmlgen.py =================================================================== --- FormEncode/trunk/formencode/htmlgen.py 2005-08-24 14:36:35 UTC (rev 937) +++ FormEncode/trunk/formencode/htmlgen.py 2005-08-24 16:58:15 UTC (rev 938) @@ -56,6 +56,8 @@ """ +from __future__ import generators + from cgi import escape import elementtree.ElementTree as et |
|
From: <sub...@co...> - 2005-08-21 00:10:24
|
Author: ianb
Date: 2005-08-21 00:10:12 +0000 (Sun, 21 Aug 2005)
New Revision: 931
Modified:
FormEncode/trunk/formencode/htmlfill.py
Log:
Fixed a problem submitted by Marek Baczynski (0 is false, so you couldn't have a default of 0)
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2005-08-20 21:36:49 UTC (rev 930)
+++ FormEncode/trunk/formencode/htmlfill.py 2005-08-21 00:10:12 UTC (rev 931)
@@ -192,8 +192,9 @@
and self.errors.get(self.get_attr(attrs, 'name'))):
self.add_class(attrs, self.error_class)
if t in ('text', 'hidden', 'submit', 'reset', 'button'):
- self.set_attr(attrs, 'value', value or
- self.get_attr(attrs, 'value', ''))
+ if value is None:
+ value = self.get_attr(attrs, 'value', '')
+ self.set_attr(attrs, 'value', value)
self.write_tag('input', attrs, startend)
self.skip_next = True
self.add_key(name)
|
|
From: <sub...@co...> - 2005-08-19 03:18:51
|
Author: ianb
Date: 2005-08-19 03:18:47 +0000 (Fri, 19 Aug 2005)
New Revision: 923
Modified:
FormEncode/tags/0.2/setup.py
Log:
Changed version number
Modified: FormEncode/tags/0.2/setup.py
===================================================================
--- FormEncode/tags/0.2/setup.py 2005-08-19 03:17:58 UTC (rev 922)
+++ FormEncode/tags/0.2/setup.py 2005-08-19 03:18:47 UTC (rev 923)
@@ -3,7 +3,7 @@
from setuptools import setup
setup(name="FormEncode",
- version="0.2",
+ version="0.2.1",
description="HTML form validation, generation, and convertion package",
long_description="""\
FormEncode validates and converts nested structures. It allows for
|
|
From: <sub...@co...> - 2005-08-19 03:18:02
|
Author: ianb Date: 2005-08-19 03:17:58 +0000 (Fri, 19 Aug 2005) New Revision: 922 Added: FormEncode/tags/0.2.1/ Log: Prepare for release Copied: FormEncode/tags/0.2.1 (from rev 921, FormEncode/trunk) |
|
From: <sub...@co...> - 2005-08-16 03:23:57
|
Author: ianb
Date: 2005-08-16 03:23:48 +0000 (Tue, 16 Aug 2005)
New Revision: 914
Modified:
FormEncode/trunk/formencode/compound.py
Log:
Make sure compound validators apply in correct order
Modified: FormEncode/trunk/formencode/compound.py
===================================================================
--- FormEncode/trunk/formencode/compound.py 2005-08-15 02:00:36 UTC (rev 913)
+++ FormEncode/trunk/formencode/compound.py 2005-08-16 03:23:48 UTC (rev 914)
@@ -65,11 +65,15 @@
can pass in lists of validators, which will be ANDed)
"""
- def attempt_convert(self, value, state, convertFunc):
+ def attempt_convert(self, value, state, validate):
lastException = None
- for validator in self.validators:
+ if validate is to_python:
+ validators = self.validators[::-1]
+ else:
+ validators = self.validators
+ for validator in validators:
try:
- return convertFunc(validator, value, state)
+ return validate(validator, value, state)
except Invalid, e:
lastException = e
if self.if_invalid is NoDefault:
@@ -89,8 +93,14 @@
return '<All %s>' % self.validators
def attempt_convert(self, value, state, validate):
+ # To preserve the order of the transformations, we do them
+ # differently when we are converting to and from python.
+ if validate is to_python:
+ validators = self.validators[::-1]
+ else:
+ validators = self.validators
try:
- for validator in self.validators:
+ for validator in validators:
value = validate(validator, value, state)
return value
except Invalid:
|
|
From: <sub...@co...> - 2005-08-15 02:00:42
|
Author: ianb Date: 2005-08-15 02:00:36 +0000 (Mon, 15 Aug 2005) New Revision: 913 Modified: FormEncode/tags/0.2/setup.cfg FormEncode/tags/0.2/setup.py Log: Changes for release version Modified: FormEncode/tags/0.2/setup.cfg =================================================================== --- FormEncode/tags/0.2/setup.cfg 2005-08-15 01:47:04 UTC (rev 912) +++ FormEncode/tags/0.2/setup.cfg 2005-08-15 02:00:36 UTC (rev 913) @@ -1,6 +1,2 @@ [easy_install] find_links = http://svn.pythonpaste.org/package_index.html - -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: FormEncode/tags/0.2/setup.py =================================================================== --- FormEncode/tags/0.2/setup.py 2005-08-15 01:47:04 UTC (rev 912) +++ FormEncode/tags/0.2/setup.py 2005-08-15 02:00:36 UTC (rev 913) @@ -10,7 +10,7 @@ a declarative form of defining the validation, and decoupled processes for filling and generating forms. """, - classifiers=["Development Status :: 3 - Alpha", + classifiers=["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Python Software Foundation License", "Programming Language :: Python", @@ -18,11 +18,10 @@ ], author="Ian Bicking", author_email="ia...@co...", - url="http://svn.colorstudy.com/Formencode/trunk", + url="http://formencode.org", license="PSF", packages=["formencode", "formencode.util"], package_data={'formencode': ['javascript/*']}, - download_url="@@", extras_require={'testing': ['elementtree']}, ) |
|
From: <sub...@co...> - 2005-08-15 01:47:08
|
Author: ianb Date: 2005-08-15 01:47:04 +0000 (Mon, 15 Aug 2005) New Revision: 912 Added: FormEncode/tags/0.2/ Log: Prepare for release Copied: FormEncode/tags/0.2 (from rev 911, FormEncode/trunk) |
|
From: <sub...@co...> - 2005-08-15 01:46:58
|
Author: ianb Date: 2005-08-15 01:46:54 +0000 (Mon, 15 Aug 2005) New Revision: 911 Added: FormEncode/tags/ Log: Tag dir |
|
From: <sub...@co...> - 2005-08-15 01:39:01
|
Author: ianb Date: 2005-08-15 01:38:56 +0000 (Mon, 15 Aug 2005) New Revision: 910 Modified: FormEncode/trunk/setup.cfg FormEncode/trunk/setup.py Log: Fixed up version number for in-development version Modified: FormEncode/trunk/setup.cfg =================================================================== --- FormEncode/trunk/setup.cfg 2005-08-15 01:37:20 UTC (rev 909) +++ FormEncode/trunk/setup.cfg 2005-08-15 01:38:56 UTC (rev 910) @@ -1,2 +1,6 @@ [easy_install] find_links = http://svn.pythonpaste.org/package_index.html + +[egg_info] +tag_build = dev +tag_svn_revision = true Modified: FormEncode/trunk/setup.py =================================================================== --- FormEncode/trunk/setup.py 2005-08-15 01:37:20 UTC (rev 909) +++ FormEncode/trunk/setup.py 2005-08-15 01:38:56 UTC (rev 910) @@ -3,7 +3,7 @@ from setuptools import setup setup(name="FormEncode", - version="0.1", + version="0.2", description="HTML form validation, generation, and convertion package", long_description="""\ FormEncode validates and converts nested structures. It allows for |
|
From: <sub...@co...> - 2005-08-15 01:37:32
|
Author: ianb
Date: 2005-08-15 01:37:20 +0000 (Mon, 15 Aug 2005)
New Revision: 909
Added:
FormEncode/trunk/docs/test_docs.py
FormEncode/trunk/setup.cfg
FormEncode/trunk/tests/conftest.py
Modified:
FormEncode/trunk/setup.py
FormEncode/trunk/tests/test_htmlfill.py
Log:
Rearranged test setup, adding elementree loading and (optional) requirement
Added: FormEncode/trunk/docs/test_docs.py
===================================================================
--- FormEncode/trunk/docs/test_docs.py 2005-08-14 20:48:15 UTC (rev 908)
+++ FormEncode/trunk/docs/test_docs.py 2005-08-15 01:37:20 UTC (rev 909)
@@ -0,0 +1,17 @@
+import os, sys
+from py.compat import doctest
+import pkg_resources
+pkg_resources.require('FormEncode[testing]')
+
+sys.path.insert(
+ 0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'formencode'))
+
+def test_doctests():
+ for fn in os.listdir(os.path.dirname(__file__)):
+ if fn.endswith('.txt'):
+ yield do_doctest, fn
+
+def do_doctest(fn):
+ return doctest.testfile(
+ fn,
+ optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE)
Added: FormEncode/trunk/setup.cfg
===================================================================
--- FormEncode/trunk/setup.cfg 2005-08-14 20:48:15 UTC (rev 908)
+++ FormEncode/trunk/setup.cfg 2005-08-15 01:37:20 UTC (rev 909)
@@ -0,0 +1,2 @@
+[easy_install]
+find_links = http://svn.pythonpaste.org/package_index.html
Modified: FormEncode/trunk/setup.py
===================================================================
--- FormEncode/trunk/setup.py 2005-08-14 20:48:15 UTC (rev 908)
+++ FormEncode/trunk/setup.py 2005-08-15 01:37:20 UTC (rev 909)
@@ -23,6 +23,7 @@
packages=["formencode", "formencode.util"],
package_data={'formencode': ['javascript/*']},
download_url="@@",
+ extras_require={'testing': ['elementtree']},
)
# Send announce to:
Added: FormEncode/trunk/tests/conftest.py
===================================================================
--- FormEncode/trunk/tests/conftest.py 2005-08-14 20:48:15 UTC (rev 908)
+++ FormEncode/trunk/tests/conftest.py 2005-08-15 01:37:20 UTC (rev 909)
@@ -0,0 +1,8 @@
+import sys, os
+sys.path.insert(0, os.path.join(
+ os.path.dirname(os.path.dirname(__file__)), 'formencode'))
+import pkg_resources
+try:
+ import elementtree
+except ImportError:
+ pkg_resources.require('FormEncode[testing]')
Modified: FormEncode/trunk/tests/test_htmlfill.py
===================================================================
--- FormEncode/trunk/tests/test_htmlfill.py 2005-08-14 20:48:15 UTC (rev 908)
+++ FormEncode/trunk/tests/test_htmlfill.py 2005-08-15 01:37:20 UTC (rev 909)
@@ -6,6 +6,8 @@
os.path.abspath(__file__))))
if base_dir not in sys.path:
sys.path.insert(0, base_dir)
+import formencode
+print '>>>>', formencode.__file__
from formencode import htmlfill
from formencode.doctest_xml_compare import xml_compare
from elementtree import ElementTree as et
|