From 735e8a8703924fd2180664c741e5b120f13a8c81 Mon Sep 17 00:00:00 2001 From: Anon Date: Mon, 24 Oct 2022 23:58:39 -0700 Subject: [PATCH] Removed unnecessary shuffle feature --- default/cfg.py | 1 - docs/configuration.md | 2 -- src/yandere_bot.py | 9 --------- 3 files changed, 12 deletions(-) diff --git a/default/cfg.py b/default/cfg.py index 9fec6ef..0a6bf33 100644 --- a/default/cfg.py +++ b/default/cfg.py @@ -81,7 +81,6 @@ settings_behavior = { "content_type": "text/plain", "content_newline": "\n", "post_image_link": False, - "post_random": False, "tmp_dir": "/var/tmp", "debug": False } diff --git a/docs/configuration.md b/docs/configuration.md index 162dc26..25874bd 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -65,8 +65,6 @@ This is the main configuration setting for the bot. **`post_image_link:`** If set to `True` this will insert a direct media link at the end of the message for each media file uploaded. If `content_type` is `'text\markdown'` it will make the link actionable, otherwise it will simply be a plain text html link. Some instances add this link automatically, in which case this should be set to `False`. See `content_newline` and `content_type` to correctly configure actionable links. -**`post_random:`** Shuffle all items in `master_list` so that they post in random order. - **`tmp_dir:`** The temporary directory to use if `atomic_saving` is set to `True`. The default location is `/var/tmp`. **`debug:`** Set this to true for testing. This will prevent Yandere Lewd Bot from logging into the mastodon instance and asking for your encryption password (meaning that nothing will actually get posted to your account, but it will still do everything else). diff --git a/src/yandere_bot.py b/src/yandere_bot.py index 973ec58..5593522 100644 --- a/src/yandere_bot.py +++ b/src/yandere_bot.py @@ -19,11 +19,8 @@ import yanlib import os -import datetime import contextlib import fnmatch -import math -import shutil from threading import Event from mastodon import Mastodon, MastodonIllegalArgumentError, MastodonAPIError, MastodonVersionError @@ -183,11 +180,6 @@ class YandereBot: self.listPictures = self.load_pictures(list_blacklist) self.lenBlacklist = len(list_blacklist) - def shuffle_list(self): - if self.settings_behavior["post_random"]: - import random - random.seed(os.urandom(16)) - random.shuffle(self.listPictures) # Maybe I should remove this from the backend? def print_header_stats(self, picked): @@ -338,7 +330,6 @@ class YandereBot: def prime_bot(self): self.load_picture_list() self.validate_post_settings() - self.shuffle_list() if not self.debug_mode: self.decrypt_settings() self.login()