@@ -66,7 +66,7 @@ def run(input_stream, options):
6666 scale = int (math .ceil (float (max_value ) / value_characters ))
6767 scale = max (1 , scale )
6868
69- print "# each ∎ represents a count of %d. total %d" % (scale , total )
69+ print "# each " + options . dot + " represents a count of %d. total %d" % (scale , total )
7070
7171 if options .sort_values :
7272 data = [[value , key ] for key , value in data .items ()]
@@ -85,7 +85,7 @@ def run(input_stream, options):
8585 for value , key in data :
8686 if options .percentage :
8787 percentage = " (%0.2f%%)" % (100 * Decimal (value ) / Decimal (total ))
88- print str_format % (key [:max_length ], value , (value / scale ) * "∎" , percentage )
88+ print str_format % (key [:max_length ], value , (value / scale ) * options . dot , percentage )
8989
9090if __name__ == "__main__" :
9191 parser = OptionParser ()
@@ -104,7 +104,8 @@ def run(input_stream, options):
104104 help = "sort keys by numeric sequencing" )
105105 parser .add_option ("-p" , "--percentage" , dest = "percentage" , default = False , action = "store_true" ,
106106 help = "List percentage for each bar" )
107-
107+ parser .add_option ("--dot" , dest = "dot" , default = '∎' , help = "Dot representation" )
108+
108109 (options , args ) = parser .parse_args ()
109110
110111 if sys .stdin .isatty ():
0 commit comments