Factorize
  • Overview
  • Repository
  • Tickets
  • Statistics
  • Projects

Repository

Add an option to show a plaintext graph

Parent commits : 2916ca1955bd7be7b04f9c7ab09f10f403ff406d,
Children commits : 489f86e762c9107d5b4d452903651ce477567e1c,

By Laurent Defert on 2011-04-11 11:39:12
Add an option to show a plaintext graph

Browse content
Difference with parent commit 2916ca1955bd7be7b04f9c7ab09f10f403ff406d
Files modified:
factorize.py
--- 
+++ 
@@ -231,10 +231,12 @@
 
 if __name__ == "__main__":
 	opt_parser = OptionParser(usage="usage: %prog [options] file_to_view")
-	opt_parser.add_option("-s", "--skip", help="skip the first X fields of each line (default: 3)",
+	opt_parser.add_option("-s", "--skip", help="Skip the first X fields of each line (default: 3)",
 			dest="skipped_fields", metavar="X")
+	opt_parser.add_option("-p", "--plaintext", help="Output plaintext tree to stdout (no GUI)",
+			action="store_true", dest="plaintext", default=False)
 	(opt, args) = opt_parser.parse_args()
-	
+
 	if opt.skipped_fields is None:
 		opt.skipped_fields = 3
 	else:
@@ -243,6 +245,10 @@
 	if len(args) == 0:
 		opt_parser.print_help()
 		exit(1)
+
 	log = LogFile(args[0], opt)
-	#log.display()
-	gui.start(log, opt)
+
+	if opt.plaintext:
+		log.tree.display()
+	else:
+		gui.start(log, opt)

Generated with KisssPM