portageq: Automatically do not include imported functions in the list of commands.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Mon, 24 Sep 2012 22:27:09 +0000 (00:27 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Mon, 24 Sep 2012 22:27:09 +0000 (00:27 +0200)
bin/portageq

index 3e7577b9c80bf2a3896318fe280c27ea3bd1a0b2..142f8806c7254ab614ecfeebb2639a5bbc669138 100755 (executable)
@@ -773,11 +773,9 @@ list_preserved_libs.uses_eroot = True
 # DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!
 #
 
-non_commands = frozenset(['elog', 'eval_atom_use',
-       'exithandler', 'expand_new_virt', 'main',
-       'usage', 'writemsg', 'writemsg_stdout'])
+non_commands = frozenset(['elog', 'eval_atom_use', 'exithandler', 'main', 'usage'])
 commands = sorted(k for k, v in globals().items() \
-       if k not in non_commands and isinstance(v, types.FunctionType))
+       if k not in non_commands and isinstance(v, types.FunctionType) and v.__module__ == "__main__")
 
 def usage(argv):
        print(">>> Portage information query tool")