diff options
Diffstat (limited to 'tqdm/contrib')
-rw-r--r-- | tqdm/contrib/__init__.py | 2 | ||||
-rw-r--r-- | tqdm/contrib/discord.py | 8 | ||||
-rw-r--r-- | tqdm/contrib/logging.py | 2 | ||||
-rw-r--r-- | tqdm/contrib/slack.py | 8 | ||||
-rw-r--r-- | tqdm/contrib/telegram.py | 10 |
5 files changed, 15 insertions, 15 deletions
diff --git a/tqdm/contrib/__init__.py b/tqdm/contrib/__init__.py index 7338c96..d059461 100644 --- a/tqdm/contrib/__init__.py +++ b/tqdm/contrib/__init__.py @@ -17,7 +17,7 @@ class DummyTqdmFile(ObjectWrapper): """Dummy file-like that will write to tqdm""" def __init__(self, wrapped): - super(DummyTqdmFile, self).__init__(wrapped) + super().__init__(wrapped) self._buf = [] def write(self, x, nolock=False): diff --git a/tqdm/contrib/discord.py b/tqdm/contrib/discord.py index 1e41308..fd663f9 100644 --- a/tqdm/contrib/discord.py +++ b/tqdm/contrib/discord.py @@ -27,7 +27,7 @@ class DiscordIO(MonoWorker): """Non-blocking file-like IO using a Discord Bot.""" def __init__(self, token, channel_id): """Creates a new message in the given `channel_id`.""" - super(DiscordIO, self).__init__() + super().__init__() config = ClientConfig() config.token = token client = Client(config) @@ -91,10 +91,10 @@ class tqdm_discord(tqdm_auto): kwargs.pop('token', getenv("TQDM_DISCORD_TOKEN")), kwargs.pop('channel_id', getenv("TQDM_DISCORD_CHANNEL_ID"))) kwargs['mininterval'] = max(1.5, kwargs.get('mininterval', 1.5)) - super(tqdm_discord, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def display(self, **kwargs): - super(tqdm_discord, self).display(**kwargs) + super().display(**kwargs) fmt = self.format_dict if fmt.get('bar_format', None): fmt['bar_format'] = fmt['bar_format'].replace( @@ -104,7 +104,7 @@ class tqdm_discord(tqdm_auto): self.dio.write(self.format_meter(**fmt)) def clear(self, *args, **kwargs): - super(tqdm_discord, self).clear(*args, **kwargs) + super().clear(*args, **kwargs) if not self.disable: self.dio.write("") diff --git a/tqdm/contrib/logging.py b/tqdm/contrib/logging.py index b8eaec5..e06febe 100644 --- a/tqdm/contrib/logging.py +++ b/tqdm/contrib/logging.py @@ -18,7 +18,7 @@ class _TqdmLoggingHandler(logging.StreamHandler): self, tqdm_class=std_tqdm # type: Type[std_tqdm] ): - super(_TqdmLoggingHandler, self).__init__() + super().__init__() self.tqdm_class = tqdm_class def emit(self, record): diff --git a/tqdm/contrib/slack.py b/tqdm/contrib/slack.py index d4c850c..9bca8ee 100644 --- a/tqdm/contrib/slack.py +++ b/tqdm/contrib/slack.py @@ -27,7 +27,7 @@ class SlackIO(MonoWorker): """Non-blocking file-like IO using a Slack app.""" def __init__(self, token, channel): """Creates a new message in the given `channel`.""" - super(SlackIO, self).__init__() + super().__init__() self.client = WebClient(token=token) self.text = self.__class__.__name__ try: @@ -88,10 +88,10 @@ class tqdm_slack(tqdm_auto): kwargs.pop('token', getenv("TQDM_SLACK_TOKEN")), kwargs.pop('channel', getenv("TQDM_SLACK_CHANNEL"))) kwargs['mininterval'] = max(1.5, kwargs.get('mininterval', 1.5)) - super(tqdm_slack, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def display(self, **kwargs): - super(tqdm_slack, self).display(**kwargs) + super().display(**kwargs) fmt = self.format_dict if fmt.get('bar_format', None): fmt['bar_format'] = fmt['bar_format'].replace( @@ -105,7 +105,7 @@ class tqdm_slack(tqdm_auto): self.sio.write(self.format_meter(**fmt)) def clear(self, *args, **kwargs): - super(tqdm_slack, self).clear(*args, **kwargs) + super().clear(*args, **kwargs) if not self.disable: self.sio.write("") diff --git a/tqdm/contrib/telegram.py b/tqdm/contrib/telegram.py index cbeadf2..0191518 100644 --- a/tqdm/contrib/telegram.py +++ b/tqdm/contrib/telegram.py @@ -27,7 +27,7 @@ class TelegramIO(MonoWorker): def __init__(self, token, chat_id): """Creates a new message in the given `chat_id`.""" - super(TelegramIO, self).__init__() + super().__init__() self.token = token self.chat_id = chat_id self.session = Session() @@ -118,10 +118,10 @@ class tqdm_telegram(tqdm_auto): self.tgio = TelegramIO( kwargs.pop('token', getenv('TQDM_TELEGRAM_TOKEN')), kwargs.pop('chat_id', getenv('TQDM_TELEGRAM_CHAT_ID'))) - super(tqdm_telegram, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def display(self, **kwargs): - super(tqdm_telegram, self).display(**kwargs) + super().display(**kwargs) fmt = self.format_dict if fmt.get('bar_format', None): fmt['bar_format'] = fmt['bar_format'].replace( @@ -131,14 +131,14 @@ class tqdm_telegram(tqdm_auto): self.tgio.write(self.format_meter(**fmt)) def clear(self, *args, **kwargs): - super(tqdm_telegram, self).clear(*args, **kwargs) + super().clear(*args, **kwargs) if not self.disable: self.tgio.write("") def close(self): if self.disable: return - super(tqdm_telegram, self).close() + super().close() if not (self.leave or (self.leave is None and self.pos == 0)): self.tgio.delete() |