def sudoify_command_str(command_string):
    ask = config.get_global('Sudo', 'ask') == 'True'
    if ask:
        password = get_password()
    else:
        password = config.get_global('Sudo', 'password')
    command_string = ('echo %s | sudo -S %s' % (password, command_string))
    return command_string
def sudoify_command_list(command_list):
    ask = config.get_global('Sudo', 'ask') == 'True'
    if ask:
        password = get_password()
    else:
        password = config.get_global('Sudo', 'password')
    command_list = ['echo',password,'|','sudo','-S'] +command_list
    return command_list
 def get_global_config(self, section, config_option):
     """
     Get a user configuration that is global for PAULA.
     @param section: The section of the config file to look in.
     @param config_option: The name of the config option
     @return: The value of the given configuration option. This is always a string.
     """
     return config.get_global(section, config_option)