Returns:
The number of rows/columns on the current console or None
if we can't tell or an error occurred.
+
+ Raises:
+ Exception: if the console size can't be determined.
"""
from pyutils.exec_utils import cmd
left_end: the character at the left side of the graph
right_end: the character at the right side of the graph
+ Raises:
+ ValueError: if percentage is invalid
+
See also :meth:`bar_graph`, :meth:`sparkline`.
>>> bar_graph_string(5, 10, fgcolor='', reset_seq='')
* 'r' = right alignment
padding: the padding character to use while justifying
+ Raises:
+ ValueError: if alignment argument is invalid.
+
>>> justify_string('This is another test', width=40, alignment='c')
' This is another test '
>>> justify_string('This is another test', width=40, alignment='l')
else:
string = padding + string
else:
- raise ValueError
+ raise ValueError('alignment must be l, r, j, or c.')
return string