Skip to content

Commit 1ba386b

Browse files
author
Gareth
authored
Merge pull request #478 from Labelbox/revert-477-jt/fixtutorialsformat
Revert "making the new tutorial script yapf friendly"
2 parents 51b7b64 + cdb4a97 commit 1ba386b

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

examples/scripts/tutorials.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616

1717
def upload_doc(path, section):
18-
title = path.split('/')[-1].replace(".ipynb",
19-
'').capitalize().replace('_', ' ')
18+
title = path.split('/')[-1].replace(".ipynb", '').capitalize().replace('_', ' ')
2019

2120
with open(path) as fb:
2221
nb = nbformat.reads(json.dumps(json.load(fb)), as_version=4)
@@ -74,29 +73,29 @@ def make_sections(sections):
7473

7574

7675
def change_name(slug, title, headers):
77-
resp = requests.put(f'{README_DOC_ENDPOINT}/{slug}',
78-
json={
79-
"title": title,
80-
"category": CATEGORY_ID
81-
},
82-
headers=headers)
76+
resp = requests.put(
77+
f'{README_DOC_ENDPOINT}/{slug}',
78+
json={
79+
"title": title,
80+
"category": CATEGORY_ID
81+
},
82+
headers=headers
83+
)
8384
resp.raise_for_status()
8485

8586

8687
def erase_category_docs(cat_slug):
87-
headers = {"Accept": "application/json", "Authorization": README_AUTH}
88+
headers = {
89+
"Accept": "application/json",
90+
"Authorization": README_AUTH
91+
}
8892

89-
response = requests.request(
90-
"GET",
91-
f'https://dash.readme.com/api/v1/categories/{cat_slug}/docs',
92-
headers=headers)
93+
response = requests.request("GET", f'https://dash.readme.com/api/v1/categories/{cat_slug}/docs', headers=headers)
9394
docs = response.json()
9495
for doc in docs:
9596
for child in doc["children"]:
96-
resp = requests.delete(f'{README_DOC_ENDPOINT}/{child["slug"]}',
97-
headers=headers)
98-
resp = requests.delete(f'{README_DOC_ENDPOINT}/{doc["slug"]}',
99-
headers=headers)
97+
resp = requests.delete(f'{README_DOC_ENDPOINT}/{child["slug"]}', headers=headers)
98+
resp = requests.delete(f'{README_DOC_ENDPOINT}/{doc["slug"]}', headers=headers)
10099

101100

102101
@click.command()

0 commit comments

Comments
 (0)