Changeset 294:17a4cdcc0619 for tools.py
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools.py
r291 r294 21 21 # SOFTWARE. 22 22 23 import md5 23 24 import os 24 25 import re … … 41 42 return os.path.abspath(path) 42 43 44 def url_to_anchor(url): 45 """ 46 Return a string, specific for the URL `url`, which is usable as an 47 anchor in HTML links. 48 """ 49 # this implementation has a _very_ small chance to reuse the same 50 # anchor for different URLs 51 return md5.new(url).hexdigest()[:10] 52