Changeset 4288 for waeup/branches/ulif-rewrite/src
- Timestamp:
- 14 Jun 2009, 13:27:04 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/csvfile/README.txt
r4284 r4288 20 20 ================ 21 21 22 :class:`CSVFile` 23 ---------------- 24 22 25 .. class:: CSVFile(filepath) 23 26 … … 78 81 79 82 Get a sorted list of header fields in the wrapped CSV file. 83 84 85 :func:`getCSVFile` 86 ---------------------- 80 87 81 88 .. function:: getCSVFile(filepath) … … 219 226 220 227 If we want to get a wrapper best suited for our purposes, we can also 221 use the `getCSVFile` function:228 use the :func:`getCSVFile` function: 222 229 223 230 >>> from waeup.csvfile.csvfile import getCSVFile … … 258 265 .. _getcsvfiledecision: 259 266 260 How `getCSVFile()` decides which wrapper to use 261 ----------------------------------------------- 262 263 Apparently, getCSVFile performes some magic: given a certain CSV file, 264 it decides which one of all registered wrappers suits the file best. 267 268 How :func:`getCSVFile` decides which wrapper to use 269 --------------------------------------------------- 270 271 Apparently, :func:`getCSVFile` performes some magic: given a certain 272 CSV file, it decides which one of all registered wrappers suits the 273 file best. 265 274 266 275 This decision is based on a score, which is computed as shown below … … 359 368 The special things here are: 360 369 361 * Derive from `CSVFile`362 363 `getCSVFile()` looks only for classes that are derived from364 `CSVFile`. So if you want your wrapper to be found by this function,365 derive from `CSVFile`.366 367 As `CSVFile` is an adapter, also our custom wrapper will become one368 (adapting strings):370 * Derive from :class:`CSVFile` 371 372 :func:`getCSVFile` looks only for classes that are derived from 373 :class:`CSVFile`. So if you want your wrapper to be found by this function, 374 derive from :class:`CSVFile`. 375 376 As :class:`CSVFile` is an adapter, also our custom wrapper will 377 become one (adapting strings): 369 378 370 379 >>> ICustomCSVFile(path) … … 401 410 -------------------------------------------- 402 411 403 The type of a CSVFile is determined by the interfaces it provides. 412 The type of a :class:`CSVFile` is determined by the interfaces it 413 provides. 404 414 405 415 If we want to get a wrapper that also guarantees to support certain … … 543 553 544 554 We can also create an importer without knowing the type of CSV file 545 before, using the `getCSVFile` function:555 before, using the :func:`getCSVFile` function: 546 556 547 557 >>> from waeup.csvfile import getCSVFile
Note: See TracChangeset for help on using the changeset viewer.