From f9a50bf9d4d4befaff09c3e9082ac8746a503246 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:06:27 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../versions/0dacc823f716_add_users_table.py | 1 + ...cf8013_add_order_column_remove_priority.py | 1 + ...d7c011daa_add_viewers_column_to_raidlog.py | 1 + .../3e66938a16ed_add_knownbots_table.py | 1 + .../434ccd372270_add_settings_table.py | 1 + ...cf993_add_groups_to_announcements_table.py | 1 + .../versions/452c8ad899fb_add_clip_table.py | 1 + .../513776307301_add_subscriptions_table.py | 1 + ...66b_add_image_column_to_triviaquestions.py | 1 + ...f4db_add_added_by_column_to_clips_table.py | 1 + ...a59c8ba5242_add_announcement_categories.py | 1 + ...0b348d98ac_add_enabled_column_to_trivia.py | 1 + bot/alembic/versions/7ab138e9d692_new_init.py | 1 + ...7e445071ceea_add_auth_levels_to_webauth.py | 1 + .../80d6b49d2d7b_add_announcements_table.py | 1 + .../81c034a85150_add_triviaresults_table.py | 1 + ..._add_priority_column_to_triviaquestions.py | 1 + bot/alembic/versions/85a4c884a14d_add_wigs.py | 1 + .../8669398e89c8_add_ignorelist_table.py | 1 + .../versions/8afcb0f7aad7_add_trivia_table.py | 1 + .../versions/8bd30e288c20_add_bot_tables.py | 1 + ...88e748f_add_subs_gifted_column_to_users.py | 1 + ..._add_webhook_settings_to_settings_table.py | 1 + bot/alembic/versions/adde2f8bdd4e_.py | 1 + ...121e9831b_fix_column_width_for_commands.py | 1 + .../bddf52d4e7df_add_webauth_table.py | 1 + .../c320b5588087_add_raidlog_table.py | 1 + ..._add_table_for_linkstodiscordignorelist.py | 1 + .../cef784ac0fd1_add_api_key_column.py | 1 + .../e36c52193286_add_botregex_table.py | 1 + ...ba4_add_sound_column_to_triviaquestions.py | 1 + bot/helpers/ResistorColourCode.py | 20 +------------------ bot/trivia_import.py | 6 +++--- mosquitto/test_connection.py | 1 + readme.md | 2 +- 35 files changed, 37 insertions(+), 23 deletions(-) diff --git a/bot/alembic/versions/0dacc823f716_add_users_table.py b/bot/alembic/versions/0dacc823f716_add_users_table.py index 05de6155..08e5688d 100644 --- a/bot/alembic/versions/0dacc823f716_add_users_table.py +++ b/bot/alembic/versions/0dacc823f716_add_users_table.py @@ -5,6 +5,7 @@ Create Date: 2020-12-07 01:06:17.925049 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/0e0348cf8013_add_order_column_remove_priority.py b/bot/alembic/versions/0e0348cf8013_add_order_column_remove_priority.py index 4ccc3cf3..0ae188ca 100644 --- a/bot/alembic/versions/0e0348cf8013_add_order_column_remove_priority.py +++ b/bot/alembic/versions/0e0348cf8013_add_order_column_remove_priority.py @@ -5,6 +5,7 @@ Create Date: 2021-09-18 03:56:47.857223 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import mysql diff --git a/bot/alembic/versions/159d7c011daa_add_viewers_column_to_raidlog.py b/bot/alembic/versions/159d7c011daa_add_viewers_column_to_raidlog.py index b63d1039..bfd7a6aa 100644 --- a/bot/alembic/versions/159d7c011daa_add_viewers_column_to_raidlog.py +++ b/bot/alembic/versions/159d7c011daa_add_viewers_column_to_raidlog.py @@ -5,6 +5,7 @@ Create Date: 2021-09-22 00:32:19.808568 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/3e66938a16ed_add_knownbots_table.py b/bot/alembic/versions/3e66938a16ed_add_knownbots_table.py index dde0eb28..60cceffc 100644 --- a/bot/alembic/versions/3e66938a16ed_add_knownbots_table.py +++ b/bot/alembic/versions/3e66938a16ed_add_knownbots_table.py @@ -5,6 +5,7 @@ Create Date: 2021-09-26 21:54:39.942452 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/434ccd372270_add_settings_table.py b/bot/alembic/versions/434ccd372270_add_settings_table.py index dea23a3f..cb9b3756 100644 --- a/bot/alembic/versions/434ccd372270_add_settings_table.py +++ b/bot/alembic/versions/434ccd372270_add_settings_table.py @@ -5,6 +5,7 @@ Create Date: 2020-12-07 01:10:18.187418 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/446ec21cf993_add_groups_to_announcements_table.py b/bot/alembic/versions/446ec21cf993_add_groups_to_announcements_table.py index e33b3b44..958af8e8 100644 --- a/bot/alembic/versions/446ec21cf993_add_groups_to_announcements_table.py +++ b/bot/alembic/versions/446ec21cf993_add_groups_to_announcements_table.py @@ -5,6 +5,7 @@ Create Date: 2020-12-07 01:12:22.822310 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/452c8ad899fb_add_clip_table.py b/bot/alembic/versions/452c8ad899fb_add_clip_table.py index bc36fd9a..ef584211 100644 --- a/bot/alembic/versions/452c8ad899fb_add_clip_table.py +++ b/bot/alembic/versions/452c8ad899fb_add_clip_table.py @@ -5,6 +5,7 @@ Create Date: 2021-08-08 23:20:09.526773 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/513776307301_add_subscriptions_table.py b/bot/alembic/versions/513776307301_add_subscriptions_table.py index e71505a5..512acd2d 100644 --- a/bot/alembic/versions/513776307301_add_subscriptions_table.py +++ b/bot/alembic/versions/513776307301_add_subscriptions_table.py @@ -5,6 +5,7 @@ Create Date: 2020-12-07 01:09:09.982788 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/582e42d1d66b_add_image_column_to_triviaquestions.py b/bot/alembic/versions/582e42d1d66b_add_image_column_to_triviaquestions.py index 48e10f8c..bfca9cb1 100644 --- a/bot/alembic/versions/582e42d1d66b_add_image_column_to_triviaquestions.py +++ b/bot/alembic/versions/582e42d1d66b_add_image_column_to_triviaquestions.py @@ -5,6 +5,7 @@ Create Date: 2021-09-05 02:08:27.308744 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/5eeef2a9f4db_add_added_by_column_to_clips_table.py b/bot/alembic/versions/5eeef2a9f4db_add_added_by_column_to_clips_table.py index 6e42bc3d..a79dc9dc 100644 --- a/bot/alembic/versions/5eeef2a9f4db_add_added_by_column_to_clips_table.py +++ b/bot/alembic/versions/5eeef2a9f4db_add_added_by_column_to_clips_table.py @@ -5,6 +5,7 @@ Create Date: 2021-08-12 22:05:30.082688 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/6a59c8ba5242_add_announcement_categories.py b/bot/alembic/versions/6a59c8ba5242_add_announcement_categories.py index 5d205f5d..78240196 100644 --- a/bot/alembic/versions/6a59c8ba5242_add_announcement_categories.py +++ b/bot/alembic/versions/6a59c8ba5242_add_announcement_categories.py @@ -5,6 +5,7 @@ Create Date: 2020-12-20 20:01:09.178912 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/6c0b348d98ac_add_enabled_column_to_trivia.py b/bot/alembic/versions/6c0b348d98ac_add_enabled_column_to_trivia.py index f69a1f9f..c6549e40 100644 --- a/bot/alembic/versions/6c0b348d98ac_add_enabled_column_to_trivia.py +++ b/bot/alembic/versions/6c0b348d98ac_add_enabled_column_to_trivia.py @@ -5,6 +5,7 @@ Create Date: 2021-04-18 20:16:42.779934 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/7ab138e9d692_new_init.py b/bot/alembic/versions/7ab138e9d692_new_init.py index 9fdd8848..f3be5ae7 100644 --- a/bot/alembic/versions/7ab138e9d692_new_init.py +++ b/bot/alembic/versions/7ab138e9d692_new_init.py @@ -5,6 +5,7 @@ Create Date: 2020-12-07 00:49:55.397509 """ + import sqlalchemy as sa # noqa F401 from alembic import op # noqa F401 diff --git a/bot/alembic/versions/7e445071ceea_add_auth_levels_to_webauth.py b/bot/alembic/versions/7e445071ceea_add_auth_levels_to_webauth.py index 8144798b..9a489911 100644 --- a/bot/alembic/versions/7e445071ceea_add_auth_levels_to_webauth.py +++ b/bot/alembic/versions/7e445071ceea_add_auth_levels_to_webauth.py @@ -5,6 +5,7 @@ Create Date: 2021-07-26 23:47:06.132000 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/80d6b49d2d7b_add_announcements_table.py b/bot/alembic/versions/80d6b49d2d7b_add_announcements_table.py index 00e59545..318116ac 100644 --- a/bot/alembic/versions/80d6b49d2d7b_add_announcements_table.py +++ b/bot/alembic/versions/80d6b49d2d7b_add_announcements_table.py @@ -5,6 +5,7 @@ Create Date: 2020-12-07 01:09:57.486760 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/81c034a85150_add_triviaresults_table.py b/bot/alembic/versions/81c034a85150_add_triviaresults_table.py index fa928f7b..da1a779d 100644 --- a/bot/alembic/versions/81c034a85150_add_triviaresults_table.py +++ b/bot/alembic/versions/81c034a85150_add_triviaresults_table.py @@ -5,6 +5,7 @@ Create Date: 2021-04-09 00:02:50.832576 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/8527dda7e7d7_add_priority_column_to_triviaquestions.py b/bot/alembic/versions/8527dda7e7d7_add_priority_column_to_triviaquestions.py index 9211e8e9..601a0538 100644 --- a/bot/alembic/versions/8527dda7e7d7_add_priority_column_to_triviaquestions.py +++ b/bot/alembic/versions/8527dda7e7d7_add_priority_column_to_triviaquestions.py @@ -5,6 +5,7 @@ Create Date: 2021-09-06 01:45:06.649226 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/85a4c884a14d_add_wigs.py b/bot/alembic/versions/85a4c884a14d_add_wigs.py index 117b8f2d..9e17c46a 100644 --- a/bot/alembic/versions/85a4c884a14d_add_wigs.py +++ b/bot/alembic/versions/85a4c884a14d_add_wigs.py @@ -5,6 +5,7 @@ Create Date: 2020-12-26 13:35:24.959829 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/8669398e89c8_add_ignorelist_table.py b/bot/alembic/versions/8669398e89c8_add_ignorelist_table.py index 7d81fc8e..0f5ff9a3 100644 --- a/bot/alembic/versions/8669398e89c8_add_ignorelist_table.py +++ b/bot/alembic/versions/8669398e89c8_add_ignorelist_table.py @@ -5,6 +5,7 @@ Create Date: 2021-02-21 19:02:31.488065 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/8afcb0f7aad7_add_trivia_table.py b/bot/alembic/versions/8afcb0f7aad7_add_trivia_table.py index 2302de86..cd8a7f03 100644 --- a/bot/alembic/versions/8afcb0f7aad7_add_trivia_table.py +++ b/bot/alembic/versions/8afcb0f7aad7_add_trivia_table.py @@ -5,6 +5,7 @@ Create Date: 2021-03-22 02:05:14.433645 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/8bd30e288c20_add_bot_tables.py b/bot/alembic/versions/8bd30e288c20_add_bot_tables.py index 6f771d96..3a73df6c 100644 --- a/bot/alembic/versions/8bd30e288c20_add_bot_tables.py +++ b/bot/alembic/versions/8bd30e288c20_add_bot_tables.py @@ -5,6 +5,7 @@ Create Date: 2020-12-07 03:53:21.400821 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/94f1e88e748f_add_subs_gifted_column_to_users.py b/bot/alembic/versions/94f1e88e748f_add_subs_gifted_column_to_users.py index cd33f665..b481242d 100644 --- a/bot/alembic/versions/94f1e88e748f_add_subs_gifted_column_to_users.py +++ b/bot/alembic/versions/94f1e88e748f_add_subs_gifted_column_to_users.py @@ -5,6 +5,7 @@ Create Date: 2021-02-28 18:44:31.070532 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/a149fe1ee31d_add_webhook_settings_to_settings_table.py b/bot/alembic/versions/a149fe1ee31d_add_webhook_settings_to_settings_table.py index 2e99d8cc..5d79e01c 100644 --- a/bot/alembic/versions/a149fe1ee31d_add_webhook_settings_to_settings_table.py +++ b/bot/alembic/versions/a149fe1ee31d_add_webhook_settings_to_settings_table.py @@ -5,6 +5,7 @@ Create Date: 2021-10-02 02:38:20.670237 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/adde2f8bdd4e_.py b/bot/alembic/versions/adde2f8bdd4e_.py index 221499fc..d715a020 100644 --- a/bot/alembic/versions/adde2f8bdd4e_.py +++ b/bot/alembic/versions/adde2f8bdd4e_.py @@ -5,6 +5,7 @@ Create Date: 2020-12-20 06:09:37.580898 """ + from alembic import op diff --git a/bot/alembic/versions/b21121e9831b_fix_column_width_for_commands.py b/bot/alembic/versions/b21121e9831b_fix_column_width_for_commands.py index b23ea6ff..0e24ea65 100644 --- a/bot/alembic/versions/b21121e9831b_fix_column_width_for_commands.py +++ b/bot/alembic/versions/b21121e9831b_fix_column_width_for_commands.py @@ -5,6 +5,7 @@ Create Date: 2021-05-10 02:17:52.361209 """ + # import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/bddf52d4e7df_add_webauth_table.py b/bot/alembic/versions/bddf52d4e7df_add_webauth_table.py index 00e62ad0..6d446a89 100644 --- a/bot/alembic/versions/bddf52d4e7df_add_webauth_table.py +++ b/bot/alembic/versions/bddf52d4e7df_add_webauth_table.py @@ -5,6 +5,7 @@ Create Date: 2021-07-25 22:40:03.107459 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/c320b5588087_add_raidlog_table.py b/bot/alembic/versions/c320b5588087_add_raidlog_table.py index 207a42a8..067a23c6 100644 --- a/bot/alembic/versions/c320b5588087_add_raidlog_table.py +++ b/bot/alembic/versions/c320b5588087_add_raidlog_table.py @@ -5,6 +5,7 @@ Create Date: 2021-09-21 23:58:18.456607 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/c83d861f83b1_add_table_for_linkstodiscordignorelist.py b/bot/alembic/versions/c83d861f83b1_add_table_for_linkstodiscordignorelist.py index 4080ce9e..0cd249a0 100644 --- a/bot/alembic/versions/c83d861f83b1_add_table_for_linkstodiscordignorelist.py +++ b/bot/alembic/versions/c83d861f83b1_add_table_for_linkstodiscordignorelist.py @@ -5,6 +5,7 @@ Create Date: 2020-12-31 07:30:21.134870 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/cef784ac0fd1_add_api_key_column.py b/bot/alembic/versions/cef784ac0fd1_add_api_key_column.py index 18a464c5..558f5921 100644 --- a/bot/alembic/versions/cef784ac0fd1_add_api_key_column.py +++ b/bot/alembic/versions/cef784ac0fd1_add_api_key_column.py @@ -5,6 +5,7 @@ Create Date: 2021-08-05 00:49:21.765654 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/e36c52193286_add_botregex_table.py b/bot/alembic/versions/e36c52193286_add_botregex_table.py index 075238a4..8fda6dde 100644 --- a/bot/alembic/versions/e36c52193286_add_botregex_table.py +++ b/bot/alembic/versions/e36c52193286_add_botregex_table.py @@ -5,6 +5,7 @@ Create Date: 2021-09-27 01:04:49.471171 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/alembic/versions/e44461c52ba4_add_sound_column_to_triviaquestions.py b/bot/alembic/versions/e44461c52ba4_add_sound_column_to_triviaquestions.py index 0fc3519f..d9238cc9 100644 --- a/bot/alembic/versions/e44461c52ba4_add_sound_column_to_triviaquestions.py +++ b/bot/alembic/versions/e44461c52ba4_add_sound_column_to_triviaquestions.py @@ -5,6 +5,7 @@ Create Date: 2021-09-04 19:19:50.259010 """ + import sqlalchemy as sa from alembic import op diff --git a/bot/helpers/ResistorColourCode.py b/bot/helpers/ResistorColourCode.py index 5135c1c2..0e9da002 100644 --- a/bot/helpers/ResistorColourCode.py +++ b/bot/helpers/ResistorColourCode.py @@ -31,7 +31,6 @@ class ValuesSeries(object): - """This class defines the properties of resistor value series like the standardised E6, E12, E24, E48, E96 and E192 resistor series values. @@ -40,7 +39,6 @@ class ValuesSeries(object): ############################################## def __init__(self, name, number_of_digits, tolerances, values): - """The parameter *name* gives the name of the series, the parameter *number_of_digits* defines the number of digits of the values, the parameter *tolerances* gives the list of tolerances and *values* gives the series of values. @@ -104,7 +102,6 @@ def __len__(self): ############################################## def tolerance_min(self): - """Return the minimum tolerance.""" return min(self.tolerances) @@ -112,7 +109,6 @@ def tolerance_min(self): ############################################## def tolerance_max(self): - """Return the maximum tolerance.""" return max(self.tolerances) @@ -501,7 +497,6 @@ def tolerance_max(self): def series_iterator(number_of_digits_min=2, number_of_digits_max=3, tolerance_min=1, tolerance_max=5): - """Return an iterator over the series that match the given constraints on the number of digits range and the tolerance ranges. """ @@ -578,7 +573,6 @@ def series_iterator(number_of_digits_min=2, number_of_digits_max=3, tolerance_mi def format_value(x): - """Return a string representation of a number *x* using the multiplier m, k, M and G, for example the number 1230 will be formated as 1.23 k. @@ -600,7 +594,6 @@ def format_value(x): class ColourCode(object): - """This class defines the meaning of a colour for the digit, the multiplier, the tolerance and the temperature coefficient. @@ -665,7 +658,7 @@ def __repr__(self): COLOUR_CODES = {} for i, colour_name in enumerate(COLOUR_NAMES): digit = i - 2 - multiplier = 10 ** digit + multiplier = 10**digit # digit is defined positive if digit < 0: digit = None @@ -677,7 +670,6 @@ def __repr__(self): class Resistor(object): - """This class represents a resitor. Public attributes: @@ -750,7 +742,6 @@ def __init__( ############################################## def _init_tolerance(self, tolerance): - """Set the tolerance from a colour or a real number.""" if tolerance is None: @@ -766,7 +757,6 @@ def _init_tolerance(self, tolerance): ############################################## def _init_temperature_coefficient(self, temperature_coefficient): - """Set the temperature coefficient from a colour or a real number.""" if temperature_coefficient is None: @@ -782,7 +772,6 @@ def _init_temperature_coefficient(self, temperature_coefficient): ############################################## def _compute_value_from_colours(self): - """compute the resistance value from the colour code.""" try: @@ -803,7 +792,6 @@ def _compute_value_from_colours(self): ############################################## def _guess_series(self): - """Guess the series of the resistor. @@ -836,7 +824,6 @@ def _guess_series(self): ############################################## def value_range(self): - """Return the resistance range according to the resistance tolerance.""" if self.tolerance is not None: @@ -874,7 +861,6 @@ def __str__(self): ############################################## def digit_colour_iterator(self): - """Return a iterator over the colours of the resistance value.""" return iter( @@ -890,7 +876,6 @@ def digit_colour_iterator(self): class ResistorDecoder(object): - """This class implements a resistor decoder using an inference algorithm: * The given list of colours doesn't require to be oriented (code polarity), both orientation @@ -909,7 +894,6 @@ class ResistorDecoder(object): ############################################## def _append_hypothesis(self, resistor_configuration, hypotheses): - """Append an hypothesis if it is acceptable.""" # print 'Try:', keys @@ -933,7 +917,6 @@ def _append_hypothesis(self, resistor_configuration, hypotheses): ############################################## def _decode(self, colour_names, hypotheses): - """Decode a resistor in one direction from the given list of colour *colour_names*.""" two_digits_bands = ["digit1", "digit2", "multiplier"] @@ -959,7 +942,6 @@ def _decode(self, colour_names, hypotheses): ############################################## def decode(self, colour_names): - """Decode a resistor from the given list of colour *colour_names*.""" number_of_colours = len(colour_names) diff --git a/bot/trivia_import.py b/bot/trivia_import.py index 6a656dd7..c3fa43c5 100644 --- a/bot/trivia_import.py +++ b/bot/trivia_import.py @@ -20,9 +20,9 @@ text=values["text"], answers=json.dumps(values["answers"]), explain=values["explain"], - last_used_date=datetime.fromisoformat(values["last_used_date"]) - if values["last_used_date"] != "" - else datetime.min, + last_used_date=( + datetime.fromisoformat(values["last_used_date"]) if values["last_used_date"] != "" else datetime.min + ), last_update_date=datetime.today(), created_date=datetime.fromisoformat(values["created_date"]) if values["created_date"] != "" else datetime.min, created_by=values["created_by"], diff --git a/mosquitto/test_connection.py b/mosquitto/test_connection.py index f9ce311d..059403f0 100644 --- a/mosquitto/test_connection.py +++ b/mosquitto/test_connection.py @@ -7,6 +7,7 @@ Passwords demo code """ + import json import random import time diff --git a/readme.md b/readme.md index f1a3a985..c45163a6 100644 --- a/readme.md +++ b/readme.md @@ -322,4 +322,4 @@ All Stream related MQTT topics are prefixed with `stream/` - `first_time_chatter` TwitchBot sends json `{"author":"author name", "timestamp"=str(datetime.now())}` when a new chatter is seen ever. - `new_chatter_topic` TwitchBot sends json `{"author":"author name", "timestamp"=str(datetime.now())}` when a new chatter is seen for the first time this stream. -This is a test, this is only a test. \ No newline at end of file +This is a test, this is only a test.