redditwarp.siteprocs.subreddit_style_old.SYNC
#
- class redditwarp.siteprocs.subreddit_style_old.SYNC.SubredditStyleOldProcedures(client: Client)[source]#
Bases:
object
- get_stylesheet(sr: str) StylesheetInfo [source]#
Get a subreddit’s stylesheet information.
This endpoint can be called without being a moderator of the target subreddit. You don’t even have to be logged in.
- Parameters:
sr (str) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
redditwarp.http.exceptions.StatusCodeException –
302
:The subreddit does not exist.
- edit_stylesheet(sr: str, content: str, *, message: str = '') None [source]#
Update a subreddit’s stylesheet.
The stylesheet can also be updated by editing the
config/stylesheet
wiki page.- Parameters:
sr (str) –
content (str) –
message (str) – A commit message.
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
redditwarp.http.exceptions.StatusCodeException –
404
:The subreddit does not exist.
- add_stylesheet_image(sr: str, name: str, file: IO[bytes]) None [source]#
Upload an image for use in the subreddit stylesheet.
- Parameters:
sr (str) –
name (str) – Must be a valid CSS identifier.
file (IO[bytes]) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
BAD_CSS_NAME
:The
name
parameter was not specified or was an invalid CSS identifier.
IMAGE_ERROR
:The image file was invalid.
redditwarp.http.exceptions.StatusCodeException –
403
:You do not have permission to upload an image to the specified subreddit.
- remove_stylesheet_image(sr: str, name: str) None [source]#
Delete an image from the subreddit’s stylesheet custom image set.
The image will no longer count against the subreddit’s image limit, however the actual image data may still be accessible for an unspecified amount of time. If the image is currently referenced by the subreddit’s stylesheet, that stylesheet will no longer validate and won’t be submittable until the image reference is removed.
If the specified image name does not exist, it is treated as a success.
- Parameters:
sr (str) –
name (str) –
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
500
:The
name
parameter was empty.
- set_icon(sr: str, file: IO[bytes]) None [source]#
Set the subreddit icon.
- Parameters:
sr (str) –
file (IO[bytes]) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
IMAGE_ERROR
:The image file was invalid.
redditwarp.http.exceptions.StatusCodeException –
403
:You do not have permission to upload an image to the specified subreddit.
- unset_icon(sr: str) None [source]#
Remove the subreddit’s icon.
- Parameters:
sr (str) –
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
403
:You do not have permission.
- set_mobile_icon(sr: str, file: IO[bytes]) None [source]#
Set the mobile icon.
- Parameters:
sr (str) –
file (IO[bytes]) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
IMAGE_ERROR
:The image file was invalid.
redditwarp.http.exceptions.StatusCodeException –
403
:You do not have permission to upload an image to the specified subreddit.
- unset_mobile_icon(sr: str) None [source]#
Remove the mobile icon.
- Parameters:
sr (str) –
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
403
:You do not have permission.
- set_mobile_banner(sr: str, file: IO[bytes]) None [source]#
Set the mobile banner icon.
- Parameters:
sr (str) –
file (IO[bytes]) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
IMAGE_ERROR
:The image file was invalid.
redditwarp.http.exceptions.StatusCodeException –
403
:You do not have permission to upload an image to the specified subreddit.
- unset_mobile_banner(sr: str) None [source]#
Remove the mobile banner icon.
- Parameters:
sr (str) –
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
403
:You do not have permission.