From 4b3d20dd95501946ed454b2932e477fde36813cb Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 19 Nov 2013 02:11:08 +0400 Subject: [PATCH] Refactor collection of text and comments nodes --- xml-ANNOUNCE | 3 +++ xml-minidom | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/xml-ANNOUNCE b/xml-ANNOUNCE index 876a6db..bdd1bd7 100644 --- a/xml-ANNOUNCE +++ b/xml-ANNOUNCE @@ -5,6 +5,9 @@ WHAT IS IT View an XML file in Midnight Commander as a filesystem. +WHAT'S NEW in version 0.3.2 (2013-11-19) + Refactored collection of text and comments nodes. + WHAT'S NEW in version 0.3.1 (2013-11-18) Fixed a bug in directories permissions. diff --git a/xml-minidom b/xml-minidom index 9dbfac6..26d5d86 100755 --- a/xml-minidom +++ b/xml-minidom @@ -32,7 +32,7 @@ The VFS was inspired by a FUSE xmlfs: https://github.com/halhen/xmlfs """ -__version__ = "0.3.1" +__version__ = "0.3.2" __author__ = "Oleg Broytman " __copyright__ = "Copyright (C) 2013 PhiloSoft Design" __license__ = "GPL" @@ -134,12 +134,11 @@ def _list(node, path=''): attr_text = _attrs2text(attrs) print "-r--r--r-- 1 user group %d Jan 1 00:00 %s/attributes" % ( len(attr_text), subpath_encoded) + text = _collect_text(element) + if text: + print "-r--r--r-- 1 user group %d Jan 1 00:00 %s/text" % ( + len(text), subpath_encoded) _list(element, subpath) - if path: - text = _collect_text(node) - if text: - print "-r--r--r-- 1 user group %d Jan 1 00:00 %s/text" % ( - len(text), path.encode(default_encoding, "replace")) def mcxml_list(): """List the entire VFS""" -- 2.39.2