1111from SoftLayer import utils
1212from pprint import pprint as pp
1313
14+
1415@click .command ()
1516@click .argument ('identifier' )
1617@click .option ('--details' , is_flag = True , default = False , show_default = True ,
@@ -23,7 +24,8 @@ def cli(env, identifier, details):
2324 top_items = manager .get_billing_items (identifier )
2425
2526 title = "Invoice %s" % identifier
26- table = formatting .Table (["Item Id" , "category" , "description" , "Single" , "Monthly" , "Create Date" , "Location" ], title = title )
27+ table = formatting .Table (["Item Id" , "category" , "description" , "Single" ,
28+ "Monthly" , "Create Date" , "Location" ], title = title )
2729 table .align ['category' ] = 'l'
2830 table .align ['description' ] = 'l'
2931 for item in top_items :
@@ -43,7 +45,7 @@ def cli(env, identifier, details):
4345 utils .lookup (item , 'location' , 'name' )
4446 ])
4547 if details :
46- for child in item .get ('children' ,[]):
48+ for child in item .get ('children' , []):
4749 table .add_row ([
4850 '>>>' ,
4951 utils .lookup (child , 'category' , 'name' ),
@@ -56,5 +58,6 @@ def cli(env, identifier, details):
5658
5759 env .fout (table )
5860
61+
5962def nice_string (ugly_string , limit = 100 ):
60- return (ugly_string [:limit ] + '..' ) if len (ugly_string ) > limit else ugly_string
63+ return (ugly_string [:limit ] + '..' ) if len (ugly_string ) > limit else ugly_string
0 commit comments