diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index 072f5014..dfc61682 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -22,146 +22,19 @@ def hydroxide(path): return pword -class oauth: - def get_client_id(account): - cmd = check_output("pass " + account, shell=True) +def get_client_id(account): + cmd = check_output("pass " + account, shell=True) - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) - - def get_client_secret(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) - - def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) -#! /usr/bin/env python -from subprocess import check_output -import re +def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) -def get_pass(account): - return check_output("pass " + account, shell=True).splitlines()[0] +def get_client_token(account): + cmd = check_output("pass " + account, shell=True) - -def get_user(account): - usercmd = check_output("pass " + account, shell=True) - - return re.search(rb"login: (.*)", usercmd, flags=0).group(1) - - -def hydroxide(path): - - file = open(path, "r") - - pword = file.read() - - return pword - - -class oauth: - def get_client_id(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) - - def get_client_secret(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) - - def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) - - -#! /usr/bin/env python -from subprocess import check_output -import re - - -def get_pass(account): - return check_output("pass " + account, shell=True).splitlines()[0] - - -def get_user(account): - usercmd = check_output("pass " + account, shell=True) - - return re.search(rb"login: (.*)", usercmd, flags=0).group(1) - - -def hydroxide(path): - - file = open(path, "r") - - pword = file.read() - - return pword - - -class oauth: - def get_client_id(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) - - def get_client_secret(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) - - def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) - - -#! /usr/bin/env python -from subprocess import check_output -import re - - -def get_pass(account): - return check_output("pass " + account, shell=True).splitlines()[0] - - -def get_user(account): - usercmd = check_output("pass " + account, shell=True) - - return re.search(rb"login: (.*)", usercmd, flags=0).group(1) - - -def hydroxide(path): - - file = open(path, "r") - - pword = file.read() - - return pword - - -class oauth: - def get_client_id(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) - - def get_client_secret(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) - - def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) - - def get_client_refresh_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1) + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index 67a04c65..e0e554f4 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -36,5 +36,5 @@ auth_mechanisms = XOAUTH2 oauth2_request_url = https://login.microsoftonline.com/common/oauth2/v2.0/token oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 # thunderbird's token not mine lol oauth2_client_secret = "" # no need for this lmao -oauth2_refresh_token_eval = oauth.get_client_refresh_token("Microsoft") -oauth2_access_token_eval = oauth.get_client_token("Microsoft") \ No newline at end of file +oauth2_refresh_token_eval = get_client_refresh_token("Microsoft") +oauth2_access_token_eval = get_client_token("Microsoft") \ No newline at end of file