1313
1414import dataclasses
1515from time import time
16- from typing import Any , cast
16+ from typing import Any , ClassVar , cast
1717
1818import file_keeper as fk
1919import flask
@@ -113,11 +113,13 @@ class Storage(fk.Storage):
113113
114114 settings : Settings
115115 reader : Reader
116+ uploader : Uploader
117+ manager : Manager
116118
117- SettingsFactory : type [Settings ] = Settings # pyright: ignore[reportIncompatibleVariableOverride]
118- ReaderFactory : type [Reader ] = Reader # pyright: ignore[reportIncompatibleVariableOverride]
119- UploaderFactory : type [Uploader ] # pyright: ignore[reportIncompatibleVariableOverride]
120- ManagerFactory : type [Manager ] # pyright: ignore[reportIncompatibleVariableOverride]
119+ SettingsFactory : ClassVar [ type [Settings ] ] = Settings # pyright: ignore[reportIncompatibleVariableOverride]
120+ UploaderFactory : ClassVar [ type [Uploader ]] = Uploader # pyright: ignore[reportIncompatibleVariableOverride]
121+ ReaderFactory : ClassVar [ type [Reader ]] = Reader # pyright: ignore[reportIncompatibleVariableOverride]
122+ ManagerFactory : ClassVar [ type [Manager ]] = Manager # pyright: ignore[reportIncompatibleVariableOverride]
121123
122124 def validate_size (self , size : int ):
123125 max_size = self .settings .max_size
@@ -140,11 +142,11 @@ def upload(self, location: fk.Location, upload: fk.Upload, /, **kwargs: Any) ->
140142 return super ().upload (location , upload , ** kwargs )
141143
142144 @override
143- def multipart_start (self , data : FileData , / , ** kwargs : Any ) -> FileData :
144- self .validate_size (data . size )
145- self .validate_content_type (data . content_type )
145+ def multipart_start (self , location : fk . Location , size : int , / , ** kwargs : Any ) -> FileData :
146+ self .validate_size (size )
147+ self .validate_content_type (kwargs . get ( " content_type" , "" ) )
146148
147- return super ().multipart_start (data , ** kwargs )
149+ return super ().multipart_start (location , size , ** kwargs )
148150
149151 @override
150152 def temporal_link (self , data : FileData , duration : int , / , ** kwargs : Any ) -> str :
0 commit comments