Changeset 396
- Timestamp:
- 02/15/07 00:49:38 (2 years ago)
- Files:
-
- pyndexter/trunk/pyndexter/__init__.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pyndexter/trunk/pyndexter/__init__.py
r393 r396 16 16 for performing automatic updates. 17 17 18 An example of indexing all .txt files underneath /usr/share/doc: 18 An example of indexing all .txt files underneath ``/usr/share/doc``: 19 20 :: 19 21 20 22 import os … … 119 121 attributes must be unicode, including the content. 120 122 121 content:: is optional, and if not provided will be fetched from the 122 `source`. If it is a callable, it will be called to fetch the content, 123 passing the uri as the only argument. 124 125 change:: should be a numeric value representing the current point in the 126 documents lifetime. Typically a timestamp, but could be a revision number, 127 etc. 128 129 source:: is the Source object where this documents content can be lazily 130 fetched from. """ 123 ``content`` 124 Optional, and if not provided will be fetched from the `source`. If it 125 is a callable, it will be called to fetch the content, passing the uri 126 as the only argument. 127 128 ``change`` 129 Should be a numeric value representing the current point in the 130 documents lifetime. Typically a timestamp, but could be a revision 131 number, etc. 132 133 ``source`` 134 Is the Source object where this documents content can be lazily fetched 135 from. """ 131 136 132 137 __slots__ = ('attributes', '_content', 'source', 'quality') … … 177 182 178 183 Determing what has changed is achieved with the state() and difference() 179 methods. The ''state''of a source is the minimum information required to184 methods. The `state` of a source is the minimum information required to 180 185 be able to determine what has changed. For FileSource this is a list of all 181 186 files and their modification times, for a SubversionSource it would be as 182 simple as the changeset number. By default, ` marshal()` and183 ` difference()` assume that `_state` will contain a dictionary of187 simple as the changeset number. By default, ``marshal()`` and 188 ``difference()`` assume that ``_state`` will contain a dictionary of 184 189 uri:modification-time mappings. 185 190
