GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-readability/readability/debug.py at master · fqxp/python-readability Expand file tree/ Copy pathdebug.pyMore file actions 25 lines (24 loc) · 845 Bytes / Copy pathdebug.pyFile metadata and controls25 lines (24 loc) · 845 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 def save_to_file(text, filename): f = open(filename, 'wt') f.write('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />') f.write(text.encode('utf-8')) f.close() uids = {} def describe(node, depth=2): if not hasattr(node, 'tag'): return "[%s]" % type(node) name = node.tag if node.get('id', ''): name += '#'+node.get('id') if node.get('class', ''): name += '.' + node.get('class').replace(' ','.') if name[:4] in ['div#', 'div.']: name = name[3:] if name in ['tr', 'td', 'div', 'p']: if not node in uids: uid = uids[node] = len(uids)+1 else: uid = uids.get(node) name += "%02d" % (uid) if depth and node.getparent() is not None: return name+' - '+describe(node.getparent(), depth-1) return name |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |