Kirk Trombley 4 年之前
父節點
當前提交
48ad226067

+ 1 - 1
lib/rollbot/decorators/__init__.py

@@ -21,4 +21,4 @@ def get_command_config() -> CommandConfiguration:
         bangs=(),
         startup=decorated_startup,
         shutdown=decorated_shutdown,
-    )
+    )

+ 1 - 1
lib/rollbot/injection/__init__.py

@@ -1,4 +1,4 @@
 from .base import inject_all, Injector, InjectorWithCleanup
 from .args import *
 from .data import *
-from .util import *
+from .util import *

+ 1 - 1
lib/rollbot/injection/args.py

@@ -39,4 +39,4 @@ class ArgParse(Injector[Namespace]):
 
 Args = ArgsInjector()
 ArgList = ArgListSplitOn()
-# TODO Arg(n)
+# TODO Arg(n)

+ 1 - 1
lib/rollbot/injection/data.py

@@ -17,4 +17,4 @@ class DatabaseInjector(InjectorWithCleanup[Connection]):
 
 
 Database = DatabaseInjector()
-# TODO data store for blob data
+# TODO data store for blob data

+ 5 - 3
lib/rollbot/injection/util.py

@@ -15,6 +15,7 @@ class MessageInjector(Injector[Message]):
     async def inject(self, message: Message, context: Context) -> Message:
         return message
 
+
 MessageInjector = MessageInjector()
 
 
@@ -22,6 +23,7 @@ class ContextInjector(Injector[Context]):
     async def inject(self, message: Message, context: Context) -> Context:
         return context
 
+
 ContextInjector = ContextInjector()
 
 Dep = TypeVar("Dep")
@@ -37,19 +39,19 @@ class Lazy(InjectorWithCleanup[Callable[[], Coroutine[None, None, Dep]]]):
         class _Wrapper:
             def __init__(self, deferred):
                 self._calculated = None
+
                 async def call():
                     if self._calculated is None:
                         self._calculated = await deferred.inject(message, context)
                     return self._calculated
+
                 self._call = call
 
             def __call__(self):
                 return self._call()
-        
+
         return _Wrapper(self.deferred)
 
     async def cleanup(self, dep: Callable[[], Coroutine[None, None, Dep]]):
         if isinstance(self.deferred, InjectorWithCleanup) and dep._calculated is not None:
             await self.deferred.cleanup(dep._calculated)
-
-

+ 1 - 3
repl_driver.py

@@ -38,9 +38,7 @@ async def count_command(message, context):
             (name,),
         )
         await db.commit()
-        async with db.execute(
-            "SELECT count FROM counter WHERE name = ?", (name,)
-        ) as cursor:
+        async with db.execute("SELECT count FROM counter WHERE name = ?", (name,)) as cursor:
             res = (await cursor.fetchone())[0]
     await context.respond(rollbot.Response.from_message(message, f"{name} = {res}"))