コード例 #1
0
 def check_config():
     config = configparser.ConfigParser()
     try:
         for config_file in get_config_files():
             config.read(config_file)
         command = config['commands']['kdu_compress']
         if not os.path.exists(command):
             raise FileNotFoundError
         return command
     except KeyError:
         raise FileNotFoundError
コード例 #2
0
def get_exiv2_path():
    """
    Attempts to retrieve the location to exiv2 command. If a path is
     specified in the settings ini file, that path will be used. Otherwise,
     the function will search for it on the path.

    Returns:
        Full path to exiv2 command if found.

    """
    warnings.warn("get_exiv2_path is deprecated. Use Exiv2Path class instead",
                  DeprecationWarning)
    config = configparser.ConfigParser()
    try:
        for config_file in get_config_files():
            config.read(config_file)
        return config['commands'].get('exiv2', shutil.which("exiv2"))
    except KeyError:
        return shutil.which("exiv2")
コード例 #3
0
 def check_config():
     config = configparser.ConfigParser()
     for config_file in get_config_files():
         config.read(config_file)
     return config['commands'].get('convert')