Skip to content

Commit 1c2afa6

Browse files
added code analyzer, fixed code styles
1 parent 1854931 commit 1c2afa6

18 files changed

+120
-90
lines changed

app/admin/examples/eg004_add_users_via_bulk_import.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,3 @@ def check_status():
9191
return import_results
9292
else:
9393
return None
94-
95-
96-
97-

app/admin/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def get_organization_id():
2020
access_token = session["ds_access_token"]
2121
api_client = ApiClient(host=DS_CONFIG["admin_api_client_host"])
2222
api_client.set_default_header(
23-
header_name="Authorization",
24-
header_value=f"Bearer {access_token}"
25-
)
23+
header_name="Authorization",
24+
header_value=f"Bearer {access_token}"
25+
)
2626

2727
accounts_api = AccountsApi(api_client)
2828
organizations = accounts_api.get_organizations()
@@ -36,9 +36,9 @@ def check_user_exists_by_email(user_email):
3636
access_token = session["ds_access_token"]
3737
api_client = ApiClient(host=DS_CONFIG["admin_api_client_host"])
3838
api_client.set_default_header(
39-
header_name="Authorization",
40-
header_value=f"Bearer {access_token}"
41-
)
39+
header_name="Authorization",
40+
header_value=f"Bearer {access_token}"
41+
)
4242

4343
users_api = UsersApi(api_client)
4444
response = users_api.get_users(organization_id=get_organization_id(), email=user_email)

app/admin/views/eg002_create_active_clm_esign_user.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def get_view():
7474
except ApiException as err:
7575
return process_error(err)
7676

77-
7877
return render_template(
7978
"eg002_create_active_clm_esign_user.html",
8079
title=example["ExampleName"],

app/docusign/ds_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ..jwt_helpers import get_jwt_token, get_private_key
1515

1616
SCOPES = [
17-
"signature"
17+
"signature"
1818
]
1919

2020
ROOMS_SCOPES = [
@@ -126,13 +126,10 @@ def _jwt_auth(cls):
126126

127127
return redirect(url_for("ds.ds_callback"))
128128

129-
130-
131129
@classmethod
132130
def destroy(cls):
133131
cls.ds_app = None
134132

135-
136133
@classmethod
137134
def login(cls, auth_type):
138135
if auth_type == "code_grant":

app/eSignature/examples/eg010_send_binary_docs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ def worker(cls, args):
103103
# Step 2. call Envelopes::create API method
104104
# Exceptions will be caught by the calling function
105105
headers = {
106-
"Authorization": "bearer " + args['access_token'],
107-
"Accept": "application/json",
108-
"Content-Type": f"multipart/form-data; boundary={boundary.decode('utf-8')}"
106+
"Authorization": "bearer " + args['access_token'],
107+
"Accept": "application/json",
108+
"Content-Type": f"multipart/form-data; boundary={boundary.decode('utf-8')}"
109109
}
110110

111111
results = requests.post(

app/eSignature/examples/eg011_embedded_sending.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def worker(args,doc_docx_path,doc_pdf_path):
4848
# Using worker from example 002
4949
results = Eg002SigningViaEmailController.worker(args, doc_docx_path, doc_pdf_path)
5050
envelope_id = results["envelope_id"]
51-
5251

5352
# Step 2. Create the sender view
5453
view_request = ReturnUrlRequest(return_url=args["ds_return_url"])

app/eSignature/examples/eg031_bulk_send.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33

44
from docusign_esign import EnvelopesApi, Document, Signer, EnvelopeDefinition, Recipients, \
55
BulkEnvelopesApi, TextCustomField, CustomFields, Tabs, SignHere
6-
from docusign_esign.models import BulkSendingCopy, BulkSendingList, BulkSendingCopyRecipient, BulkSendingCopyTab, BulkSendRequest, BulkSendBatchStatus
6+
from docusign_esign.models import BulkSendingCopy, BulkSendingList, BulkSendingCopyRecipient, BulkSendingCopyTab, \
7+
BulkSendRequest, BulkSendBatchStatus
78
from flask import request, session
89

910
from ...consts import demo_docs_path, pattern
1011
from ...docusign import create_api_client
1112
from ...ds_config import DS_CONFIG
1213

14+
1315
class Eg031BulkSendController:
1416
@staticmethod
1517
def get_args():
@@ -28,20 +30,20 @@ def get_args():
2830
"account_id": session["ds_account_id"], # Represents your {ACCOUNT_ID}
2931
"base_path": session["ds_base_path"],
3032
"access_token": session["ds_access_token"], # Represents your {ACCESS_TOKEN}
31-
"signers": [{
32-
"signer_name": signer_name_1,
33-
"signer_email": signer_email_1,
34-
"cc_email": cc_email_1,
35-
"cc_name": cc_name_1
36-
},
33+
"signers": [
34+
{
35+
"signer_name": signer_name_1,
36+
"signer_email": signer_email_1,
37+
"cc_email": cc_email_1,
38+
"cc_name": cc_name_1
39+
},
3740
{
3841
"signer_name": signer_name_2,
3942
"signer_email": signer_email_2,
4043
"cc_email": cc_email_2,
4144
"cc_name": cc_name_2
4245
}
4346
]
44-
4547
}
4648
return args
4749

@@ -105,7 +107,8 @@ def worker(cls, args):
105107

106108
# Confirm successful batch send
107109
# Step 7 start
108-
response = bulk_envelopes_api.get_bulk_send_batch_status(account_id=args["account_id"], bulk_send_batch_id=batch_id)
110+
response = bulk_envelopes_api.get_bulk_send_batch_status(account_id=args["account_id"],
111+
bulk_send_batch_id=batch_id)
109112
# Step 7 end
110113
print(response)
111114

@@ -150,6 +153,7 @@ def create_bulk_sending_list(cls, args):
150153
)
151154

152155
return bulk_sending_list
156+
153157
# Step 3-2 end
154158

155159
# Step 4-2 start
@@ -219,4 +223,4 @@ def make_draft_envelope(cls):
219223
envelope_definition.recipients = Recipients(signers=[signer], carbon_copies=[cc])
220224

221225
return envelope_definition
222-
# Step 4-2 end
226+
# Step 4-2 end

app/eSignature/examples/eg035_scheduled_sending.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
import base64
22
from os import path
33

4-
from docusign_esign import EnvelopesApi, Envelope, EnvelopeDefinition, Document, Signer, SignHere, \
5-
Tabs, Recipients, Workflow, ScheduledSending, EnvelopeDelayRule
4+
from docusign_esign import (
5+
EnvelopesApi,
6+
Envelope,
7+
EnvelopeDefinition,
8+
Document,
9+
Signer,
10+
SignHere,
11+
Tabs,
12+
Recipients,
13+
Workflow,
14+
ScheduledSending,
15+
EnvelopeDelayRule
16+
)
17+
618
from ...consts import demo_docs_path, pattern, signer_client_id
719
from ...docusign import create_api_client
820
from ...ds_config import DS_CONFIG
921

22+
1023
class Eg035ScheduledSendingController:
1124

1225
@classmethod
1326
def worker(cls, args):
14-
1527
envelope_args = args["envelope_args"]
1628
print("RESUMEDATE")
1729
print(envelope_args["resume_date"])
@@ -30,7 +42,6 @@ def worker(cls, args):
3042

3143
return {"envelope_id": envelope_id}
3244

33-
3445
@classmethod
3546
def make_envelope(cls, args, doc_docx_path, doc_pdf_path):
3647
"""
@@ -49,7 +60,7 @@ def make_envelope(cls, args, doc_docx_path, doc_pdf_path):
4960
env = EnvelopeDefinition(
5061
email_subject="Please sign this document"
5162
)
52-
63+
5364
with open(path.join(demo_docs_path, doc_pdf_path), "rb") as file:
5465
doc1_pdf_bytes = file.read()
5566
doc1_b64 = base64.b64encode(doc1_pdf_bytes).decode("ascii")
@@ -107,4 +118,4 @@ def make_envelope(cls, args, doc_docx_path, doc_pdf_path):
107118
env.status = args["status"]
108119
# Step 2 end
109120

110-
return env
121+
return env

app/eSignature/examples/eg036_delayed_routing.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
import base64
22
from os import path
33

4-
from docusign_esign import EnvelopesApi, Envelope, EnvelopeDefinition, Document, Signer, SignHere, \
5-
Tabs, Recipients, Workflow, DelayedRouting, EnvelopeDelayRule, WorkflowStep
4+
from docusign_esign import (
5+
EnvelopesApi,
6+
Envelope,
7+
EnvelopeDefinition,
8+
Document,
9+
Signer,
10+
SignHere,
11+
Tabs,
12+
Recipients,
13+
Workflow,
14+
DelayedRouting,
15+
EnvelopeDelayRule,
16+
WorkflowStep
17+
)
18+
619
from ...consts import demo_docs_path, pattern, signer_client_id
720
from ...docusign import create_api_client
821
from ...ds_config import DS_CONFIG
@@ -25,7 +38,6 @@ def worker(cls, args):
2538

2639
return {"envelope_id": envelope_id}
2740

28-
2941
@classmethod
3042
def make_envelope(cls, args, doc_docx_path, doc_pdf_path):
3143
"""

app/eSignature/examples/eg040_document_visibility.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,14 @@ def make_envelope(cls, args, doc_docx_path, doc_pdf_path):
9696
doc3_pdf_bytes = file.read()
9797
doc3_b64 = base64.b64encode(doc3_pdf_bytes).decode("ascii")
9898

99-
10099
# Create the document models
101100
document1 = Document( # create the DocuSign document object
102101
document_base64=doc1_b64,
103102
name="Order acknowledgement", # can be different from actual file name
104103
file_extension="html", # many different document types are accepted
105104
document_id="1", # a label used to reference the doc
106105
)
107-
document2 = Document( \
106+
document2 = Document(
108107
document_base64=doc2_b64,
109108
name="Battle Plan",
110109
file_extension="docx",
@@ -214,7 +213,7 @@ def create_document1(cls, args):
214213
<h3 style="margin-top:3em;">Agreed: <span style="color:white;">**signature_1**/</span></h3>
215214
</body>
216215
</html>
217-
"""
218-
# Step 3 end
219-
220-
# End
216+
"""
217+
# Step 3 end
218+
219+
# End

0 commit comments

Comments
 (0)