def retrieve_upload_credentials(): c = load_config() if 'MENPO_CDN_S3_ACCESS_KEY' in c and 'MENPO_CDN_S3_SECRET_KEY' in c: return c['MENPO_CDN_S3_ACCESS_KEY'], c['MENPO_CDN_S3_SECRET_KEY'] else: raise MissingConfigKeyError('MENPO_CDN_S3_ACCESS_KEY and ' 'MENPO_CDN_S3_SECRECT_KEY both are ' 'needed to upload cached results')
def resolve_matlab_bin_path(verbose=False): try: # Will throw key error if matlab_bin_path does not exist matlab_bin_path = Path(load_config()['matlab_bin_path']) except KeyError: # OK, there's no known matlab path, lets be proactive and try and # find it ourselves matlab_bin_path = find_matlab_binary() # If we still failed, re-throw the key-error if not matlab_bin_path: raise MissingConfigKeyError('matlab_bin_path') else: # Save the found matlab path if verbose: print('Saving automatically found Matlab path to config') configure_matlab_bin_path(matlab_bin_path) if verbose: print('Matlab path: {}'.format(matlab_bin_path)) return matlab_bin_path
def resolve_matlab_bin_path(verbose=False): try: # Will throw key error if matlab_bin_path does not exist matlab_bin_path = Path(load_config()["matlab_bin_path"]) except KeyError: # OK, there's no known matlab path, lets be proactive and try and # find it ourselves matlab_bin_path = find_matlab_binary() # If we still failed, re-throw the key-error if not matlab_bin_path: raise MissingConfigKeyError("matlab_bin_path") else: # Save the found matlab path if verbose: print("Saving automatically found Matlab path to config") configure_matlab_bin_path(matlab_bin_path) if verbose: print("Matlab path: {}".format(matlab_bin_path)) return matlab_bin_path