diff --git a/app.py b/app.py index 6c5e613..c0b3cde 100644 --- a/app.py +++ b/app.py @@ -1,9 +1,8 @@ -from flask import Flask, jsonify, request +from flask import Flask from flask_cors import CORS from dotenv import load_dotenv import os from routers import router -import traceback load_dotenv() diff --git a/controllers/index.py b/controllers/__init__.py similarity index 100% rename from controllers/index.py rename to controllers/__init__.py diff --git a/controllers/headers.py b/controllers/headers.py index 2dacd21..3038b7e 100644 --- a/controllers/headers.py +++ b/controllers/headers.py @@ -1,5 +1,5 @@ from flask import request, jsonify -from utils.createDf import createDf +from utils import createDf def headers(): diff --git a/controllers/vcf.py b/controllers/vcf.py index 37a3e41..6be20f9 100644 --- a/controllers/vcf.py +++ b/controllers/vcf.py @@ -1,6 +1,6 @@ from flask import request, Response, jsonify -from utils.createDf import createDf -from utils.vcfGenerator import generateVcf +from utils import createDf +from utils import generateVcf import json import vobject @@ -71,7 +71,8 @@ def vcf(): "Last Name":vcard.n.value.family, "Suffix":vcard.n.value.suffix, "Phone Number(s)": "/".join([tel.value for tel in vcard.tel_list]) if hasattr(vcard, 'tel') else "", - "E-Mail": "/".join([email.value for email in vcard.email_list]) if hasattr(vcard, 'email') else "" + "E-Mail": "/".join([email.value for email in vcard.email_list]) if hasattr(vcard, 'email') else "", + "Gender":vcard.gender.value }) return jcard, 200 diff --git a/routers/__init__.py b/routers/__init__.py new file mode 100644 index 0000000..50dd774 --- /dev/null +++ b/routers/__init__.py @@ -0,0 +1 @@ +from .routers import * \ No newline at end of file diff --git a/routers.py b/routers/routers.py similarity index 92% rename from routers.py rename to routers/routers.py index b995f90..3913374 100644 --- a/routers.py +++ b/routers/routers.py @@ -1,5 +1,5 @@ from flask import Blueprint -from controllers.index import * +from controllers import * router = Blueprint('router', __name__) router.add_url_rule('/', 'home', home,methods=["GET"]) diff --git a/utils/__init__.py b/utils/__init__.py new file mode 100644 index 0000000..9f4d9d7 --- /dev/null +++ b/utils/__init__.py @@ -0,0 +1,2 @@ +from .createDf import createDf +from .vcfGenerator import generateVcard,generateVcf \ No newline at end of file