#NEWLINE# def windows_init( options ) : #NEWLINE# #INDENT# 'Create an instance of WindowsSetup and catch version errors.\n\n  Args:\n    options: All command line flags.\n  Returns:\n    WindowsSetup: The object needed for setting up Windows if successful, or\n      nothing if setup fails.\n  Raises:\n    VersionUnsupportedError: If the system version is neither 32bit or 64bit\n    VersionTooLowError: If the OS is older than Windows 7\n    BadDirectoryError: If the given cwebp or cmake path does not exist.\n  ' #NEWLINE# try : #NEWLINE# #INDENT# setup = setuputil . windows . WindowsSetup ( options ) #NEWLINE# return setup #NEWLINE# #UNINDENT# except setuputil . common . VersionUnsupportedError as e : #NEWLINE# #INDENT# logging . error ( 'Your version of Windows is neither 32 nor 64 bit, and is not supported by this script.' ) #NEWLINE# raise e #NEWLINE# #UNINDENT# except setuputil . common . VersionUnsupportedError as e : #NEWLINE# #INDENT# logging . error ( ( ( 'Your version of Windows (' + e . version ) + ') is lower than the lowest supported version of this script (Windows 7).' ) ) #NEWLINE# raise e #NEWLINE# #UNINDENT# except setuputil . common . BadDirectoryError as e : #NEWLINE# #INDENT# logging . error ( ( ( ( ( 'Directory given for flag ' + options . flag ) + ' does not exist.\nPlease check ' ) + e . directory ) + ' and try again.' ) ) #NEWLINE# raise e #NEWLINE# #UNINDENT# return None