Skip to content

Commit

Permalink
Merge pull request #135 from satisfactorymodding/dev
Browse files Browse the repository at this point in the history
2.22.2
Borketh authored Sep 10, 2024
2 parents 23888aa + 2a3299e commit 4e42e45
Showing 7 changed files with 98 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ FROM python:3.12-alpine AS build
WORKDIR /deps

RUN pip --no-cache-dir install --progress-bar=off "poetry==1.8"

RUN apk update; apk add g++ git re2-dev
COPY pyproject.toml .
COPY poetry.lock .
RUN poetry install -nvvv --only main --no-root
2 changes: 1 addition & 1 deletion fred/fred.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
from .fred_commands import Commands, FredHelpEmbed
from .libraries import createembed, common

__version__ = "2.22.1"
__version__ = "2.22.2"


class Bot(commands.Bot):
4 changes: 2 additions & 2 deletions fred/fred_commands/_command_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Type

from regex import E, match, escape
from regex import ENHANCEMATCH, match, escape

from ._baseclass import BaseCmds
from ..config import Commands, Crashes, Misc
@@ -19,7 +19,7 @@ def search(table: Type[Commands | Crashes], pattern: str, column: str, force_fuz
fuzzies: list[str] = [
item["name"]
for item in table.fetch_all()
if (item.get(column, None) is not None) and match(fuzzy_pattern, item[column], flags=E)
if (item.get(column, None) is not None) and match(fuzzy_pattern, item[column], flags=ENHANCEMATCH)
]
BaseCmds.logger.info(fuzzies)
return fuzzies[:5], False
2 changes: 1 addition & 1 deletion fred/fred_commands/crashes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from regex import search, error as RegexError
from re2 import search, RegexError

from ._baseclass import BaseCmds, commands, config, SearchFlags
from ._command_utils import get_search
2 changes: 2 additions & 0 deletions fred/libraries/common.py
Original file line number Diff line number Diff line change
@@ -27,11 +27,13 @@ def new_logger(name: str) -> logging.Logger:

class FredCog(commands.Cog):
bot: Bot = ... # we can assume any cog will have a bot by the time it needs to be accessed
logger: logging.Logger = ...

def __init__(self, bot: Bot):
self.__class__.bot = bot
self.bot = bot
self.logger = new_logger(self.__class__.__name__)
self.__class__.logger = self.logger
self.logger.debug("Cog loaded.")


90 changes: 89 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fred"
version = "2.22.1"
version = "2.22.2"
description = "A Discord bot for the Satisfactory Modding Discord "
authors = ["Feyko <feykook@gmail.com>", "Mircea Roata <mircearoatapalade@yahoo.ro>", "Borketh <does.not.kompute@gmail.com>"]
license = "MIT License"
@@ -19,6 +19,7 @@ setuptools = "^72.1.0"
psycopg2-binary = "^2.9.9"
semver = "^3.0.2"
pyre2-updated = "^0.3.8"
regex = "^2024.7.24"

[tool.poetry.group.dev.dependencies]
black = {extras = ["d"], version = "^24.8.0"}

0 comments on commit 4e42e45

Please sign in to comment.