|
From: <sub...@co...> - 2007-02-06 19:41:00
|
Author: ianb
Date: 2007-02-06 12:40:20 -0700 (Tue, 06 Feb 2007)
New Revision: 2268
Modified:
FormEncode/trunk/formencode/fields.py
FormEncode/trunk/formencode/formgen.py
FormEncode/trunk/formencode/sqlformgen.py
FormEncode/trunk/formencode/sqlschema.py
Log:
Added deprecation warnings for a bunch of deprecated modules
Modified: FormEncode/trunk/formencode/fields.py
===================================================================
--- FormEncode/trunk/formencode/fields.py 2007-02-06 18:02:01 UTC (rev 2267)
+++ FormEncode/trunk/formencode/fields.py 2007-02-06 19:40:20 UTC (rev 2268)
@@ -24,6 +24,11 @@
and then there's bunches of classes for the specific kinds of fields.
"""
+import warnings
+warnings.warn("formencode.fields is deprecated with no replacement; "
+ "if you are using it please maintain your own copy of this "
+ "file", DeprecationWarning, 2)
+
import urllib
PILImage = None
import os
Modified: FormEncode/trunk/formencode/formgen.py
===================================================================
--- FormEncode/trunk/formencode/formgen.py 2007-02-06 18:02:01 UTC (rev 2267)
+++ FormEncode/trunk/formencode/formgen.py 2007-02-06 19:40:20 UTC (rev 2268)
@@ -3,22 +3,32 @@
"""
# @@: This is experimental
+import warnings
+warnings.warn("formencode.formgen is deprecated with no replacement; "
+ "if you are using it please maintain your own copy of this "
+ "file", DeprecationWarning, 2)
import fields
-import pkg_resources
-pkg_resources.require('RuleDispatch')
-import dispatch
-#@dispatch.generic()
-def makeform(obj, context):
- """
- Return ``(field_obj, Schema)``.
-
- Return a field or field container used to edit ``obj`` given the
- context. Also return a Schema object (or None for no Schema) that
- will be applied before other validation.
- """
- raise NotImplementedError
+dispatch = None
+try:
+ import pkg_resources
+ pkg_resources.require('RuleDispatch')
+ import dispatch
+except ImportError:
+ pass
-makeform = dispatch.generic()(makeform)
+if dispatch:
+ #@dispatch.generic()
+ def makeform(obj, context):
+ """
+ Return ``(field_obj, Schema)``.
+ Return a field or field container used to edit ``obj`` given the
+ context. Also return a Schema object (or None for no Schema) that
+ will be applied before other validation.
+ """
+ raise NotImplementedError
+
+ makeform = dispatch.generic()(makeform)
+
Modified: FormEncode/trunk/formencode/sqlformgen.py
===================================================================
--- FormEncode/trunk/formencode/sqlformgen.py 2007-02-06 18:02:01 UTC (rev 2267)
+++ FormEncode/trunk/formencode/sqlformgen.py 2007-02-06 19:40:20 UTC (rev 2268)
@@ -1,5 +1,10 @@
# @@: This is experimental
+import warnings
+warnings.warn("formencode.sqlformgen is deprecated with no replacement; "
+ "if you are using it please maintain your own copy of this "
+ "file", DeprecationWarning, 2)
+
import fields
import validators
import schema
Modified: FormEncode/trunk/formencode/sqlschema.py
===================================================================
--- FormEncode/trunk/formencode/sqlschema.py 2007-02-06 18:02:01 UTC (rev 2267)
+++ FormEncode/trunk/formencode/sqlschema.py 2007-02-06 19:40:20 UTC (rev 2268)
@@ -7,6 +7,11 @@
from api import Invalid
from declarative import classinstancemethod
+import warnings
+warnings.warn("formencode.sqlschema is deprecated with no replacement; "
+ "if you are using it please maintain your own copy of this "
+ "file", DeprecationWarning, 2)
+
class SQLSchema(schema.Schema):
"""
|