dotfiles

.config/offlineimap/config.py [raw] [blame]
 1#!/usr/bin/env python3
 2
 3import sys
 4import subprocess
 5
 6
 7def get_op_item(item, field):
 8    return subprocess.check_output(
 9        ['op', 'get', 'item', item, '--fields', field]
10    ).decode('utf-8')
11
12
13def get_op_username(item):
14    return get_op_item(item, 'username')
15
16
17def get_op_password(item):
18    return get_op_item(item, 'password')