@@ -145,13 +145,13 @@ def print_colored(message, color):
145145 colorize = getattr (colored , color )
146146 print (colorize (message ))
147147
148- def prompt (self , message , * , default = None , force_arg = None ):
148+ def prompt (self , message , * , default = None , force_arg = None , force_arg_value = True ):
149149 """
150150 A Yes/No prompt that accepts optional defaults
151151 Returns True for Yes and False for No
152152 """
153153 if force_arg is not None and self .argument_exists (force_arg ):
154- return True
154+ return force_arg_value
155155 if default is None :
156156 choicebox = "[y/n]"
157157 else :
@@ -491,7 +491,7 @@ def get_raspbian_version(self):
491491 """Return a string containing the raspbian version"""
492492 if self .get_os () != "Raspbian" :
493493 return None
494- raspbian_releases = ("buster" , "stretch" , "jessie" , "wheezy" )
494+ raspbian_releases = ("bullseye" , " buster" , "stretch" , "jessie" , "wheezy" )
495495 if os .path .exists ("/etc/os-release" ):
496496 with open ("/etc/os-release" , encoding = "utf-8" ) as f :
497497 release_file = f .read ()
@@ -502,9 +502,9 @@ def get_raspbian_version(self):
502502 return raspbian
503503 return None
504504
505- def prompt_reboot (self ):
505+ def prompt_reboot (self , default = "y" , ** kwargs ):
506506 """Prompt the user for a reboot"""
507- if not self .prompt ("REBOOT NOW?" , default = "y" ):
507+ if not self .prompt ("REBOOT NOW?" , default = default , ** kwargs ):
508508 print ("Exiting without reboot." )
509509 else :
510510 print ("Reboot started..." )
0 commit comments