From 9c6953067fd1132f778faa7e926e9049edf9f4c3 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 20 Jun 2011 01:33:18 +0200 Subject: Rewriting of the get_meta() function. --- cli.py | 5 ++--- lib/parser.py | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) mode change 100755 => 100644 cli.py diff --git a/cli.py b/cli.py old mode 100755 new mode 100644 index 0ba7531..2c1a0d8 --- a/cli.py +++ b/cli.py @@ -4,7 +4,7 @@ ''' import sys -import lib.mat +from lib import mat import optparse __version__ = '0.1' @@ -37,8 +37,7 @@ def list_meta(class_file, filename): Print all the meta of 'filename' on stdout ''' print('[+] File %s :' % filename) - for key, item in class_file.get_meta().iteritems(): - print('\t%s : %s' % (key, item) ) + print "\n".join([field for field in class_file.get_meta()]) def is_clean(class_file, filename): ''' diff --git a/lib/parser.py b/lib/parser.py index 828648f..7912b29 100644 --- a/lib/parser.py +++ b/lib/parser.py @@ -68,8 +68,11 @@ class Generic_parser(): ''' return a dict with all the meta of the file ''' - #am I useless ? - return self.meta + metadata = [] + for field in self.editor: + if self._should_remove(field): + metadata.append(field.name) + return metadata def _should_remove(self, key): ''' -- cgit v1.3