Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 2c997b4

Browse files
authored
Merge pull request #955 from TwilioDevEd/fix-python-snippets
Fix python snippets linter issues
2 parents 5250407 + 0bef4fe commit 2c997b4

File tree

54 files changed

+158
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+158
-130
lines changed

.github/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ runs:
1818
gem install json colorize nokogiri rubocop
1919
sudo cp twilio-api-faker/keystore/twilio_fake.pem /usr/local/share/ca-certificates/twilio_fake.crt
2020
sudo update-ca-certificates
21-
shell: bash
21+
shell: bash

.github/workflows/build_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77
pull_request:
88
branches:
9-
- master
9+
- '*'
1010

1111
env:
1212
FAKE_CERT_PATH: ~/build/TwilioDevEd/api-snippets/twilio-api-faker/keystore/twilio_fake.pem

deployed-devices/quickstarts/paho-python/publish.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
client = mqtt.Client(client_id="bob", clean_session=False)
1212

1313
#
14-
# Initialize TLS, specify trusted CA roots, client certifiate and key file locations.
15-
# You may need to adjust the location of trusted Certificate Authorities depending on your OS.
14+
# Initialize TLS, specify trusted CA roots, client certifiate and key
15+
# file locations.
16+
# You may need to adjust the location of trusted Certificate
17+
# Authorities depending on your OS.
1618
# Typical locations are /etc/ssl/cert.pem and /usr/local/ssl/cert.pem
1719
#
1820
client.tls_set("/usr/local/ssl/cert.pem",

deployed-devices/quickstarts/paho-python/subscribe-and-print.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212

1313
#
14-
# Initialize TLS, specify trusted CA roots, client certifiate and key file locations.
15-
# You may need to adjust the location of trusted Certificate Authorities depending on your OS.
14+
# Initialize TLS, specify trusted CA roots, client certifiate and key
15+
# file locations.
16+
# You may need to adjust the location of trusted Certificate
17+
# Authorities depending on your OS.
1618
# Typical locations are /etc/ssl/cert.pem and /usr/local/ssl/cert.pem
1719
#
1820
client.tls_set("/usr/local/ssl/cert.pem",

ip-messaging/rest/credentials/update-credentials/update-credentials.6.x.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
credential = client.chat \
1212
.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
13-
.update(friendly_name="MyCredential", api_key=os.environ['TWILIO_API_KEY_SECRET'])
13+
.update(friendly_name="MyCredential",
14+
api_key=os.environ['TWILIO_API_KEY_SECRET'])
1415

1516
print(credential.friendly_name)

quickstart/python/autopilot/create-first-task/create_hello_world_task.7.x.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919

2020
# Create the hello_world task
21-
# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
21+
# Replace 'UAXXX...' with your Assistant's unique SID
22+
# https://www.twilio.com/console/autopilot/list
2223
task = client.autopilot.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
2324
.tasks \
2425
.create(

quickstart/python/autopilot/create-hello-world-samples/create_hello_world_samples.7.x.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
'Hi there'
1616
]
1717

18-
# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
18+
# Replace 'UAXXX...' with your Assistant's unique SID
19+
# https://www.twilio.com/console/autopilot/list
1920
for phrase in phrases:
2021
sample = client.autopilot \
2122
.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \

quickstart/python/autopilot/create-joke-samples/create_joke_samples.7.x.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
'I\'d like to hear a punny joke'
2424
]
2525

26-
# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
26+
# Replace 'UAXXX...' with your Assistant's unique SID
27+
# https://www.twilio.com/console/autopilot/list
2728
# Replace 'UDXXX...' with the SID for the task you just created.
2829
for phrase in phrases:
2930
sample = client.autopilot \

quickstart/python/autopilot/create-joke-task/create_joke_task.7.x.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@
1111
# Provide actions for the new task
1212
joke_actions = {
1313
'actions': [
14-
{'say': 'I was going to look for my missing watch, but I could never find the time.'}
14+
{
15+
'say':
16+
'I was going to look for my missing '
17+
'watch, but I could never find the time.'
18+
}
1519
]
1620
}
1721

1822
# Create a new task named 'tell_a_joke'
19-
# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
23+
# Replace 'UAXXX...' with your Assistant's unique SID
24+
# https://www.twilio.com/console/autopilot/list
2025
task = client.autopilot \
2126
.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
2227
.tasks \

quickstart/python/autopilot/query-task/query_task.7.x.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
auth_token = os.environ['TWILIO_AUTH_TOKEN']
1010
client = Client(account_sid, auth_token)
1111

12-
# Replace 'UAXXX...' with your Assistant's unique SID https://www.twilio.com/console/autopilot/list
12+
# Replace 'UAXXX...' with your Assistant's unique SID
13+
# https://www.twilio.com/console/autopilot/list
1314
query = client.preview.understand \
1415
.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
1516
.queries \

0 commit comments

Comments
 (0)