Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit dc702a3

Browse files
author
Josh Wolff
committed
Updating description of ImageUploadExample
1 parent 48fa588 commit dc702a3

File tree

2 files changed

+48
-56
lines changed

2 files changed

+48
-56
lines changed

.idea/workspace.xml

Lines changed: 35 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spontit/examples/image_upload_example.py renamed to spontit/examples/dirty_image_upload_example.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ class ImageUploadExample(SpontitResource):
66

77
def dirty_channel_profile_image_upload(self, image_path, is_png, channel_name=None):
88
"""
9-
This function explicitly constructs the bytes sent to the server in order to upload a channel profile image.
9+
# WARNING: Don't use this method if you are using Python. It will work, but there is a far more intuitive method
10+
# in the SpontitResource. Just use spontit_resource.channel_profile_image_upload(...) and feel free to examine
11+
# the example in examples.py titled 'create_new_channel_with_profile_image_and_push_to_it'.
1012
11-
The explicit construction of the multi-part request should make it somewhat easier to develop such a request
12-
in another language.
13+
# This example illustrates how to construct the byte payload for other languages (i.e. not fully dependent on
14+
# the requests library). The explicit construction of the multi-part request should make it somewhat easier to
15+
# develop such a request in another language.
1316
1417
:param image_path: the path to the image
1518
:param is_png: whether or not the image is PNG or JPEG
@@ -69,6 +72,13 @@ def dirty_channel_profile_image_upload(self, image_path, is_png, channel_name=No
6972

7073
if __name__ == "__main__":
7174

75+
# WARNING: Don't use this method if you are using Python. It will work, but there is a far more intuitive method
76+
# in the SpontitResource. Just use spontit_resource.channel_profile_image_upload(...) and feel free to examine
77+
# the example in examples.py titled 'create_new_channel_with_profile_image_and_push_to_it'.
78+
79+
# This example illustrates how to construct the byte payload for other languages (i.e. not fully dependent on the
80+
# requests library).
81+
7282
img_upload_resource = ImageUploadExample(
7383
"my_user_id",
7484
"my_secret_key"

0 commit comments

Comments
 (0)