Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 70862 Details for
Bug 109596
Nano crash on open of attached file.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
This file crashes nano
crash_nano.txt (text/plain), 2.36 KB, created by
Justin Keogh
on 2005-10-17 10:59:43 UTC
(
hide
)
Description:
This file crashes nano
Filename:
MIME Type:
Creator:
Justin Keogh
Created:
2005-10-17 10:59:43 UTC
Size:
2.36 KB
patch
obsolete
>#!/usr/bin/python >from __future__ import generators >import os, sys >from xml.dom import Node >from Ft.Xml.Domlette import Print, PrettyPrint >from Ft.Xml.Domlette import NonvalidatingReader > >def doc_order_iterator_filter(node, filter_func): > if filter_func(node): > yield node > for child in node.childNodes: > for cn in doc_order_iterator_filter(child, filter_func): > if filter_func(cn): > yield cn > return > > > def get_elements_by_tag_name_ns(node, ns, local): > return doc_order_iterator_filter(node, lambda n: n.nodeType == Node.ELEMENT_NODE and n.namespaceURI == ns and n.localName == local) > > > def get_first_element_by_tag_name_ns(node, ns, local): > return get_elements_by_tag_name_ns(node, ns, local).next() > > > def string_value(node): > text_nodes = doc_order_iterator_filter(node, lambda n: n.nodeType == Node.TEXT_NODE) > return u''.join([ n.data for n in text_nodes ]) > > > def addFile(doc, file, filelist): > name = doc.createElementNS(None, "name") > name.appendChild(doc.createTextNode(file)) > file = doc.createElementNS(None, "file") > file.appendChild(name) > filelist.appendChild(file) > > def main(): > doc = NonvalidatingReader.parseUri(sys.argv[1]) > #don't traverse the whole DOM tree just to find the filelist element > #I assume doc.documentElement was not used in case the filelist > #XML format is embedded in another > filelist = get_first_element_by_tag_name_ns(doc, None, "filelist") > #Compute the list of names once: the algorithm doesn't require more > names = get_elements_by_tag_name_ns(doc, None, "name") > #Convert once to list of strings > names = [ string_value(n) for n in names ] > for file in os.listdir(sys.argv[2]): > if not file in names: > addFile(doc, file, filelist) > PrettyPrint(doc) > > if __name__ == "__main__": main()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 109596
: 70862