This commit is contained in:
Adrien Bourmault 2022-10-06 23:09:21 +02:00
parent efbf63ff51
commit 2ca0becf44
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
1 changed files with 3 additions and 21 deletions

View File

@ -45,10 +45,6 @@ def gestion_get_secret():
with open(GESTION_SECRET_FILE) as sfile:
return sfile.readline().replace("\n", "")
def git_get_secret():
with open(GIT_SECRET_FILE) as sfile:
return sfile.readline().replace("\n", "")
def get_file_content(filename):
with open(filename) as sfile:
return sfile.readlines()
@ -67,28 +63,14 @@ def gestion_read(req):
data = req)
return response.json()
def git_mail_ticket_read(req):
response = requests.get('https://git.a-lec.org/api/v4/projects/46/issues',
headers={'PRIVATE-TOKEN' : git_get_secret()},
params = req)
return response.json()
def git_xmpp_ticket_create(req):
response = requests.post('https://git.a-lec.org/api/v4/projects/44/issues',
headers={'PRIVATE-TOKEN' : git_get_secret()},
data = req)
return response.json()
def setup_workdir():
if not os.path.isdir(WORKDIR):
os.mkdir(WORKDIR)
if not "impayé" in os.listdir(WORKDIR):
if not "attente" in os.listdir(WORKDIR):
os.mkdir(WORKDIR+"/impayé")
if not "expiré" in os.listdir(WORKDIR):
os.mkdir(WORKDIR+"/expiré")
if not "validé" in os.listdir(WORKDIR):
if not "nouveau" in os.listdir(WORKDIR):
os.mkdir(WORKDIR+"/validé")
if not "transition" in os.listdir(WORKDIR):
if not "validé" in os.listdir(WORKDIR):
os.mkdir(WORKDIR+"/transition")
def sendmail(headers, data):