Skip to content

Commit 4641390

Browse files
committed
re-numbering examples
1 parent e3f0f5c commit 4641390

17 files changed

Lines changed: 61 additions & 36 deletions

File tree

app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565

6666
elif EXAMPLES_API_TYPE["Admin"]:
6767
app.register_blueprint(admin_examples.eg001)
68-
app.register_blueprint(admin_examples.eg002)
6968
app.register_blueprint(admin_examples.eg003)
69+
app.register_blueprint(admin_examples.eg004)
7070

7171
else:
7272
app.register_blueprint(examples.eg001)

app/admin/examples/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .eg001_create_a_new_user import eg001
2-
from .eg002_bulk_export_user_data import eg002
3-
from .eg003_add_users_via_bulk_import import eg003
2+
from .eg003_bulk_export_user_data import eg003
3+
from .eg004_add_users_via_bulk_import import eg004

app/admin/examples/eg002_bulk_export_user_data/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/admin/examples/eg003_add_users_via_bulk_import/__init__.py renamed to app/admin/examples/eg003_bulk_export_user_data/__init__.py

File renamed without changes.

app/admin/examples/eg002_bulk_export_user_data/controller.py renamed to app/admin/examples/eg003_bulk_export_user_data/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from app.ds_config import DS_CONFIG
77

88

9-
class Eg002Controller:
9+
class Eg003Controller:
1010

1111
@staticmethod
1212
def _get_export_api():

app/admin/examples/eg002_bulk_export_user_data/views.py renamed to app/admin/examples/eg003_bulk_export_user_data/views.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
from app.error_handlers import process_error
1010
from app.docusign import authenticate
1111
from app.ds_config import DS_CONFIG
12-
from .controller import Eg002Controller
12+
from .controller import Eg003Controller
1313

1414

15-
eg = "eg002" # Reference (and URL) for this example
16-
eg002 = Blueprint(eg, __name__)
15+
eg = "eg003" # Reference (and URL) for this example
16+
eg003 = Blueprint(eg, __name__)
1717

18-
@eg002.route("/eg002", methods=["POST"])
18+
@eg003.route("/eg003", methods=["POST"])
1919
@authenticate(eg=eg)
2020
def get_user_list_data():
2121
"""
@@ -25,7 +25,7 @@ def get_user_list_data():
2525

2626
# 1. Call the worker method
2727
try:
28-
results = Eg002Controller.worker()
28+
results = Eg003Controller.worker()
2929
current_app.logger.info(f"User list export ID: {results.id}")
3030
except ApiException as err:
3131
return process_error(err)
@@ -40,7 +40,7 @@ def get_user_list_data():
4040
json=json.dumps(json.dumps(results.to_dict(), default=str))
4141
)
4242

43-
@eg002.route("/eg002", methods=["GET"])
43+
@eg003.route("/eg003", methods=["GET"])
4444
@authenticate(eg=eg)
4545
def get_view():
4646
"""
@@ -49,7 +49,7 @@ def get_view():
4949

5050
# Render the response
5151
return render_template(
52-
"eg002_bulk_export_user_data.html",
52+
"eg003_bulk_export_user_data.html",
5353
title="Bulk export user data",
5454
source_file=path.basename(path.dirname(__file__)) + "/controller.py",
5555
source_url=(
@@ -59,7 +59,7 @@ def get_view():
5959
documentation=DS_CONFIG["documentation"] + eg,
6060
)
6161

62-
@eg002.route("/eg002check", methods=["GET"])
62+
@eg003.route("/eg003check", methods=["GET"])
6363
@authenticate(eg=eg)
6464
def check_if_csv_ready():
6565
"""
@@ -69,17 +69,17 @@ def check_if_csv_ready():
6969

7070
# 1. Checking if a CSV file exists
7171
try:
72-
csv_file = Eg002Controller.get_csv_user_list()
72+
csv_file = Eg003Controller.get_csv_user_list()
7373
except ApiException as err:
7474
return process_error(err)
7575

7676
# 2. Render the response
7777
return render_template(
78-
"eg002_file_state.html",
78+
"eg003_file_state.html",
7979
get_csv=bool(csv_file)
8080
)
8181

82-
@eg002.route("/eg002csv", methods=["GET"])
82+
@eg003.route("/eg003csv", methods=["GET"])
8383
@authenticate(eg=eg)
8484
def get_csv():
8585
"""
@@ -89,7 +89,7 @@ def get_csv():
8989

9090
# 1. Getting an existing CSV file
9191
try:
92-
csv_file = Eg002Controller.get_csv_user_list()
92+
csv_file = Eg003Controller.get_csv_user_list()
9393
except ApiException as err:
9494
return process_error(err)
9595

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .views import eg004

app/admin/examples/eg003_add_users_via_bulk_import/controller.py renamed to app/admin/examples/eg004_add_users_via_bulk_import/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from app.ds_config import DS_CONFIG
77

88

9-
class Eg003Controller:
9+
class Eg004Controller:
1010

1111
@staticmethod
1212
def worker(request):

app/admin/examples/eg003_add_users_via_bulk_import/csv/uploaded_file.csv renamed to app/admin/examples/eg004_add_users_via_bulk_import/csv/uploaded_file.csv

File renamed without changes.

app/admin/examples/eg003_add_users_via_bulk_import/views.py renamed to app/admin/examples/eg004_add_users_via_bulk_import/views.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Example 003: Add users via bulk import"""
1+
"""Example 004: Add users via bulk import"""
22

33
import json
44
from os import path
@@ -9,14 +9,14 @@
99
from app.error_handlers import process_error
1010
from app.docusign import authenticate
1111
from app.ds_config import DS_CONFIG
12-
from .controller import Eg003Controller
12+
from .controller import Eg004Controller
1313

1414

15-
eg = "eg003" # Reference(and URL) for this example
16-
eg003 = Blueprint(eg, __name__)
15+
eg = "eg004" # Reference(and URL) for this example
16+
eg004 = Blueprint(eg, __name__)
1717

1818

19-
@eg003.route("/eg003", methods=["POST"])
19+
@eg004.route("/eg004", methods=["POST"])
2020
@authenticate(eg=eg)
2121
def add_users_via_bulk_import():
2222
"""
@@ -26,7 +26,7 @@ def add_users_via_bulk_import():
2626

2727
# 1. Call the worker method
2828
try:
29-
results = Eg003Controller.worker(request)
29+
results = Eg004Controller.worker(request)
3030
current_app.logger.info(f"Bulk import request ID: {results.id}")
3131
except ApiException as err:
3232
return process_error(err)
@@ -40,7 +40,7 @@ def add_users_via_bulk_import():
4040
json=json.dumps(json.dumps(results.to_dict(), default=str))
4141
)
4242

43-
@eg003.route("/eg003", methods=["GET"])
43+
@eg004.route("/eg004", methods=["GET"])
4444
@authenticate(eg=eg)
4545
def get_view():
4646
"""
@@ -49,7 +49,7 @@ def get_view():
4949

5050
# Render the response
5151
return render_template(
52-
"eg003_add_users_via_bulk_import.html",
52+
"eg004_add_users_via_bulk_import.html",
5353
title="Add users via bulk import",
5454
source_file=path.basename(path.dirname(__file__)) + "/controller.py",
5555
source_url=(
@@ -59,7 +59,7 @@ def get_view():
5959
documentation=DS_CONFIG["documentation"] + eg,
6060
)
6161

62-
@eg003.route("/eg003examplecsv", methods=["GET"])
62+
@eg004.route("/eg004examplecsv", methods=["GET"])
6363
@authenticate(eg=eg)
6464
def get_csv():
6565
"""
@@ -68,7 +68,7 @@ def get_csv():
6868
"""
6969

7070
# 1. Creates an example of a CSV file
71-
csv_file = Eg003Controller.get_example_csv()
71+
csv_file = Eg004Controller.get_example_csv()
7272

7373
# 2. Returns an example of a CSV file to the user
7474
return Response(

0 commit comments

Comments
 (0)