INNER CODE UNIT · Python

get_boolean

piku/piku · piku.py:252

def get_boolean(value):
    """Convert a boolean-ish string to a boolean."""

    return value.lower() in ['1', 'on', 'true', 'enabled', 'yes', 'y']


def write_config(filename, bag, separator='='):
    """Helper for writing out config files"""

    with open(filename, 'w') as h:
        # pylint: disable=unused-variable
        for k, v in bag.items():
            h.write('{k:s}{separator:s}{v}\n'.format(**locals()))


def setup_authorized_keys(ssh_fingerprint, script_path, pubkey):
    """Sets up an authorized_keys file to redirect SSH commands"""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…