@@ -66,7 +66,7 @@ def run(input_stream, options):
66
66
scale = int (math .ceil (float (max_value ) / value_characters ))
67
67
scale = max (1 , scale )
68
68
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 )
70
70
71
71
if options .sort_values :
72
72
data = [[value , key ] for key , value in data .items ()]
@@ -85,7 +85,7 @@ def run(input_stream, options):
85
85
for value , key in data :
86
86
if options .percentage :
87
87
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 )
89
89
90
90
if __name__ == "__main__" :
91
91
parser = OptionParser ()
@@ -104,7 +104,8 @@ def run(input_stream, options):
104
104
help = "sort keys by numeric sequencing" )
105
105
parser .add_option ("-p" , "--percentage" , dest = "percentage" , default = False , action = "store_true" ,
106
106
help = "List percentage for each bar" )
107
-
107
+ parser .add_option ("--dot" , dest = "dot" , default = '∎' , help = "Dot representation" )
108
+
108
109
(options , args ) = parser .parse_args ()
109
110
110
111
if sys .stdin .isatty ():
0 commit comments