Skip to content

Commit

Permalink
Improve documentation regarding default values, and sort dicts by key
Browse files Browse the repository at this point in the history
  • Loading branch information
jackodsteel committed Dec 3, 2019
1 parent d2ff7e8 commit 8f0c462
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions praw/models/reddit/subreddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,15 +1268,15 @@ def _add(
):
url = API_PATH["flairtemplate_v2"].format(subreddit=self.subreddit)
data = {
"css_class": css_class,
"allowable_content": allowable_content,
"background_color": background_color,
"text_color": text_color,
"css_class": css_class,
"flair_type": self.flair_type(is_link),
"max_emojis": max_emojis,
"mod_only": bool(mod_only),
"text": text,
"text_color": text_color,
"text_editable": bool(text_editable),
"mod_only": bool(mod_only),
"allowable_content": allowable_content,
"max_emojis": max_emojis,
}
self.subreddit._reddit.post(url, data=data)

Expand Down Expand Up @@ -1332,7 +1332,8 @@ def update(
``'emoji'``, or ``'text'`` to restrict content to that type.
If set to ``'emoji'`` then the ``'text'`` param must be a
valid emoji string, for example ``':snoo:'``.
:param max_emojis: (int) Maximum emojis in the flair (default: 10).
:param max_emojis: (int) Maximum emojis in the flair
(Reddit defaults this value to 10).
For example to make a user flair template text_editable, try:
Expand All @@ -1352,15 +1353,15 @@ def update(
"""
url = API_PATH["flairtemplate_v2"].format(subreddit=self.subreddit)
data = {
"allowable_content": allowable_content,
"background_color": background_color,
"css_class": css_class,
"flair_template_id": template_id,
"max_emojis": max_emojis,
"mod_only": mod_only,
"text": text,
"css_class": css_class,
"background_color": background_color,
"text_color": text_color,
"text_editable": text_editable,
"mod_only": mod_only,
"allowable_content": allowable_content,
"max_emojis": max_emojis,
}
self.subreddit._reddit.post(url, data=data)

Expand Down Expand Up @@ -1412,7 +1413,8 @@ def add(
``'emoji'``, or ``'text'`` to restrict content to that type.
If set to ``'emoji'`` then the ``'text'`` param must be a
valid emoji string, for example ``':snoo:'``.
:param max_emojis: (int) Maximum emojis in the flair (default: 10).
:param max_emojis: (int) Maximum emojis in the flair
(Reddit defaults this value to 10).
For example, to add an editable Redditor flair try:
Expand Down Expand Up @@ -1493,7 +1495,8 @@ def add(
``'emoji'``, or ``'text'`` to restrict content to that type.
If set to ``'emoji'`` then the ``'text'`` param must be a
valid emoji string, for example ``':snoo:'``.
:param max_emojis: (int) Maximum emojis in the flair (default: 10).
:param max_emojis: (int) Maximum emojis in the flair
(Reddit defaults this value to 10).
For example, to add an editable link flair try:
Expand Down

0 comments on commit 8f0c462

Please sign in to comment.