From 534c2c8d346e7067b78036f7ece9a1d36a6be18e Mon Sep 17 00:00:00 2001 From: Kevin Cramer Date: Thu, 1 Oct 2015 18:05:24 -0700 Subject: [PATCH 1/7] Update support info. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index e38054f..999a987 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,7 @@ Our developer documentation can be found [here](https://api.imgur.com/). Community --------- -The best way to reach out to Imgur for API support would be our -[Google Group](https://groups.google.com/forum/#!forum/imgur), [Twitter](https://twitter.com/imgurapi), or via - api@imgur.com. +The best way to reach out to Imgur for API support is emailing us at api@imgur.com. Installation ------------ From 33776a80930fe7b6a199b1b86fd8a78786e176e2 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 27 Dec 2015 05:28:48 -0500 Subject: [PATCH 2/7] closed file in upload_from_path The file no longer remains open after calling upload_from_path(). This would previously throw warnings. --- imgurpython/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgurpython/client.py b/imgurpython/client.py index 544330b..b860a1a 100644 --- a/imgurpython/client.py +++ b/imgurpython/client.py @@ -586,13 +586,13 @@ def upload_from_path(self, path, config=None, anon=True): fd = open(path, 'rb') contents = fd.read() b64 = base64.b64encode(contents) - data = { 'image': b64, 'type': 'base64', } - data.update({meta: config[meta] for meta in set(self.allowed_image_fields).intersection(config.keys())}) + fd.close() + return self.make_request('POST', 'upload', data, anon) def upload_from_url(self, url, config=None, anon=True): From 3d2d2866770d251bc81c73732fd19fdcaabe012b Mon Sep 17 00:00:00 2001 From: Jacob Greenleaf Date: Fri, 29 Jan 2016 12:54:42 -0800 Subject: [PATCH 3/7] Add TravisYML --- .travis.yml | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8e11c2f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: python +deploy: + provider: pypi + user: imgurops + password: + secure: DBBXzMOm037T4XUmfo0Gu9mAytw2DCYJT8i0KgihKYxS+uslF+dwHf2clBEWDLUE0xkXhqXetq+sNgfshovGKIqZanASYZ/6Zf5ikg10ApgaBidObv2XMYNyuQxL8Gqv9l2tdlWqdUoOJzRBMV2Nh0B3BJ9hG7V5NFMDcfG/qyo= + on: + tags: true + repo: Imgur/imgurpython diff --git a/setup.py b/setup.py index 79bcbb8..300e786 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # http://packaging.python.org/en/latest/tutorial.html#version - version='1.1.6', + version='1.1.7', description='Official Imgur python library with OAuth2 and samples', long_description='', From 8694d428046aee4a5ea47dab55ae86e5663b6e7e Mon Sep 17 00:00:00 2001 From: Jacob Greenleaf Date: Fri, 29 Jan 2016 13:04:22 -0800 Subject: [PATCH 4/7] Add requirements.txt to let Travis install requests --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests From c43e2364c26eaeeba58abfa7f4a001528190aa73 Mon Sep 17 00:00:00 2001 From: Jacob Greenleaf Date: Fri, 29 Jan 2016 13:11:33 -0800 Subject: [PATCH 5/7] Do a simple syntax check on Travis script --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8e11c2f..cd12a9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: python +script: + - python -m compileall deploy: provider: pypi user: imgurops From cb717fe7490d304f858f00b459166f8b42900300 Mon Sep 17 00:00:00 2001 From: Khazhismel Date: Wed, 2 Dec 2015 20:45:17 -0500 Subject: [PATCH 6/7] Allow uploading file-like objects, allowing uploading of BytesIO/etc. --- imgurpython/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/imgurpython/client.py b/imgurpython/client.py index b860a1a..9c41ea6 100644 --- a/imgurpython/client.py +++ b/imgurpython/client.py @@ -580,10 +580,13 @@ def get_image(self, image_id): return Image(image) def upload_from_path(self, path, config=None, anon=True): + with open(path, 'rb') as fd: + self.upload(fd, config, anon) + + def upload(self, fd, config=None, anon=True): if not config: config = dict() - fd = open(path, 'rb') contents = fd.read() b64 = base64.b64encode(contents) data = { @@ -591,7 +594,6 @@ def upload_from_path(self, path, config=None, anon=True): 'type': 'base64', } data.update({meta: config[meta] for meta in set(self.allowed_image_fields).intersection(config.keys())}) - fd.close() return self.make_request('POST', 'upload', data, anon) From 1cd23bc471c1682247e9e5afece3305073befd26 Mon Sep 17 00:00:00 2001 From: Kevin Cramer Date: Thu, 19 Oct 2017 13:14:04 -0700 Subject: [PATCH 7/7] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 999a987..c89b846 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# The imgurpython project is no longer supported. + imgurpython ===========