Changeset 137 for pyyaml/trunk/lib/yaml/__init__.py
- Timestamp:
- 04/16/06 19:45:21 (7 years ago)
- File:
-
- 1 edited
-
pyyaml/trunk/lib/yaml/__init__.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/lib/yaml/__init__.py
r136 r137 12 12 from representer import * 13 13 14 from detector import *14 from resolver import * 15 15 16 16 from tokens import * … … 197 197 return dump_all([data], stream, Dumper=SafeDumper, **kwds) 198 198 199 def add_detector(tag, regexp, first=None, Loader=Loader, Dumper=Dumper): 199 def add_implicit_detector(tag, regexp, first=None, 200 Loader=Loader, Dumper=Dumper): 200 201 """ 201 202 Add an implicit scalar detector. … … 204 205 first is a sequence of possible initial characters or None. 205 206 """ 206 Loader.add_ detector(tag, regexp, first)207 Dumper.add_ detector(tag, regexp, first)208 209 def add_ resolver(tag, path, Loader=Loader):207 Loader.add_implicit_resolver(tag, regexp, first) 208 Dumper.add_implicit_resolver(tag, regexp, first) 209 210 def add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper): 210 211 """ 211 212 Add a path based resolver for the given tag. … … 214 215 Keys can be string values, integers, or None. 215 216 """ 216 Loader.add_resolver(tag, path) 217 Loader.add_path_resolver(tag, path, kind) 218 Dumper.add_path_resolver(tag, path, kind) 217 219 218 220 def add_constructor(tag, constructor, Loader=Loader): … … 232 234 """ 233 235 Loader.add_multi_constructor(tag_prefix, multi_constructor) 236 237 def add_representer(data_type, representer, Dumper=Dumper): 238 """ 239 Add a representer for the given type. 240 Representer is a function accepting a Dumper instance 241 and an instance of the given data type 242 and producing the corresponding representation node. 243 """ 244 Dumper.add_representer(data_type, representer) 234 245 235 246 class YAMLObjectMetaclass(type):
Note: See TracChangeset
for help on using the changeset viewer.
