actually works
Some checks failed
Gitea/kapitanbooru-uploader/pipeline/head There was a failure building this commit
Some checks failed
Gitea/kapitanbooru-uploader/pipeline/head There was a failure building this commit
Now with tagger Miejsce na zdjęcie Linki do wiki Zapis ustawień Tagger działa w tle Kolorujemy pliki po ratingu Tagger cache Tagi w bazie Pobranie implikacji tagów Autocomplete Podział na pliki i skrypty + nowe API Structure for package Version 0.1.0
This commit is contained in:
16
kapitanbooru_uploader/ProgressFile.py
Normal file
16
kapitanbooru_uploader/ProgressFile.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Klasa pomocnicza do monitorowania postępu uploadu
|
||||
class ProgressFile:
|
||||
def __init__(self, f, callback, total_size):
|
||||
self.f = f
|
||||
self.callback = callback
|
||||
self.total_size = total_size
|
||||
self.read_bytes = 0
|
||||
|
||||
def read(self, size=-1):
|
||||
data = self.f.read(size)
|
||||
self.read_bytes += len(data)
|
||||
self.callback(self.read_bytes, self.total_size)
|
||||
return data
|
||||
|
||||
def __getattr__(self, attr):
|
||||
return getattr(self.f, attr)
|
Reference in New Issue
Block a user