Skip to content

Commit 39e4aef

Browse files
committed
fix gists
1 parent 02b36b6 commit 39e4aef

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

00_core.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@
977977
"@patch\n",
978978
"def create_gist(self:GhApi, description, content, filename='gist.txt', public=False):\n",
979979
" \"Create a gist containing a single file\"\n",
980-
" return api.gists.create(description, public=public, files={filename: {\"content\": content}})"
980+
" return self.gists.create(description, public=public, files={filename: {\"content\": content}})"
981981
]
982982
},
983983
{

ghapi/_nbdev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
index = {"GH_HOST": "00_core.ipynb",
66
"GhApi": "00_core.ipynb",
7-
"GhApi.create_gist": "00_core.ipynb",
87
"date2gh": "00_core.ipynb",
98
"gh2date": "00_core.ipynb",
109
"print_summary": "00_core.ipynb",
10+
"GhApi.create_gist": "00_core.ipynb",
1111
"GhApi.delete_release": "00_core.ipynb",
1212
"GhApi.upload_file": "00_core.ipynb",
1313
"GhApi.create_release": "00_core.ipynb",

ghapi/core.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ def __getitem__(self, k):
131131
def full_docs(self):
132132
return '\n'.join(f'## {gn}\n\n{group._repr_markdown_()}\n' for gn,group in sorted(self.groups.items()))
133133

134-
# Cell
135-
@patch
136-
def create_gist(self:GhApi, description, content, filename='gist.txt', public=False):
137-
return api.gists.create(description, public=public, files={filename: {"content": content}})
138-
139134
# Cell
140135
def date2gh(dt:datetime)->str:
141136
"Convert `dt` (which is assumed to be in UTC time zone) to a format suitable for GitHub API operations"
@@ -151,6 +146,12 @@ def print_summary(req:Request):
151146
"Print `Request.summary` with the token (if any) removed"
152147
pprint(req.summary('Authorization'))
153148

149+
# Cell
150+
@patch
151+
def create_gist(self:GhApi, description, content, filename='gist.txt', public=False):
152+
"Create a gist containing a single file"
153+
return self.gists.create(description, public=public, files={filename: {"content": content}})
154+
154155
# Cell
155156
@patch
156157
def delete_release(self:GhApi, release):

0 commit comments

Comments
 (0)