From 9efbdf80aecabeeb74c518e47dd42fd5ac97dd0f Mon Sep 17 00:00:00 2001 From: Jeremy Banks Date: Tue, 27 Jan 2009 17:12:45 -0500 Subject: [PATCH] Some TODO thoughts. --- README.markdown | 8 ++++++-- gist.py | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.markdown b/README.markdown index dd7c918..9dd2fe1 100644 --- a/README.markdown +++ b/README.markdown @@ -15,11 +15,15 @@ Usage _(Will be filled in when this version if more feature-complete.)_ -`TODO` ------- +TODO +---- * Move significant code into module and out of `main()`. * Support for reading private gists. +* Use official API wherever possible (ex. public creating/reading) +* Automatically detect if you attempt to clone one of your own gists, + and use the private clone URL if so. Give overrides to force private + or public clone attempts, though. Maybe. Think about this, at least. Authors ------- diff --git a/gist.py b/gist.py index 80680ff..772ac46 100755 --- a/gist.py +++ b/gist.py @@ -11,7 +11,8 @@ URL_HTTP_GIST_VIEW = URL_HTTP_GIST + "{id}" URL_HTTP_GIST_TXT = URL_HTTP_GIST_VIEW + ".txt" URL_HTTP_GIST_POST = URL_HTTP_GIST + "gists" -URL_GIT_GIST = "git://gist.github.com/{id}.git" +URL_GIT_GIST_PUBLIC = "git://gist.github.com/{id}.git" +URL_GIT_GIST_PRIATE = "git@gist.github.com:{id}.git" def load_authentication(): """ @@ -154,7 +155,7 @@ def main(*args): post_data = urllib.parse.urlencode(post_data) - reqest = urllib.request.Request(URL_HTTP_GIST_POST, post_data) + reqest = urllib.request.Request(URL_GIT_GIST_PUBLIC, post_data) try: response = urllib.request.urlopen(reqest) @@ -197,7 +198,6 @@ def main(*args): if not clip(data): sys.stderr.write("Warning: Unable to copy data to clipboard.\n") - # BUGGY: FORMATS AS THOUGH USING REPR ON BYTES, NOT WHAT I MEAN TO BE DOING sys.stdout.write(data) sys.stderr.write("\n")