From 9ce9af8d2796d7ff0f493bc2d97fcbc3a951f8d6 Mon Sep 17 00:00:00 2001 From: rachpt Date: Mon, 1 Feb 2021 00:56:27 +0800 Subject: [PATCH] Update fstring syntax #87 --- lanzou/api/core.py | 2 +- lanzou/gui/workers/manager.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lanzou/api/core.py b/lanzou/api/core.py index 67dfced..9741b55 100644 --- a/lanzou/api/core.py +++ b/lanzou/api/core.py @@ -854,7 +854,7 @@ def upload_file(self, task: object, file_path, folder_id=-1, callback=None, allo if os.path.getsize(file_path) <= self._max_size * 1048576: return self._upload_small_file(task, file_path, folder_id, callback) elif not allow_big_file: - logger.debug(f'Forbid upload big file!file_path={file_path}, {self._max_size=}') + logger.debug(f'Forbid upload big file!file_path={file_path}, max_size={self._max_size}') return LanZouCloud.FAILED, 0, False # 不允许上传超过 max_size 的文件 # 上传超过 max_size 的文件 diff --git a/lanzou/gui/workers/manager.py b/lanzou/gui/workers/manager.py index 738eb76..13a2e44 100644 --- a/lanzou/gui/workers/manager.py +++ b/lanzou/gui/workers/manager.py @@ -139,7 +139,7 @@ def start_task(self, task): self.start() def add_task(self, task): - logger.debug(f"TaskMgr add one: {task.added=}, {task.pause=}") + logger.debug(f"TaskMgr add one: added={task.added}, pause={task.pause}") if task.url not in self._tasks.keys(): self._tasks[task.url] = task task.added = False @@ -153,7 +153,7 @@ def add_tasks(self, tasks: dict): self.start() def del_task(self, task): - logger.debug(f"TaskMgr del: {task.url=}") + logger.debug(f"TaskMgr del: url={task.url}") if task in self._queues: self._queues.remove(task) if task.url in self._tasks: @@ -164,7 +164,7 @@ def del_task(self, task): def _task_to_queue(self): for task in self._tasks.values(): if not task.added and not task.pause and task not in self._queues: - logger.debug(f"TaskMgr task2queue: {task.url=}") + logger.debug(f"TaskMgr task2queue: url={task.url}") self._queues.append(task) task.added = True @@ -191,7 +191,7 @@ def _update_emit(self): def _add_thread(self, task): self.update.emit() - logger.debug(f"TaskMgr count: {self._count=}") + logger.debug(f"TaskMgr count: count={self._count}") self._count -= 1 del self._workers[task.url] # 发送所有任务完成信号 @@ -222,7 +222,7 @@ def run(self): self.sleep(1) self._count += 1 task = self._queues.pop() - logger.debug(f"TaskMgr run: {task.url=}") + logger.debug(f"TaskMgr run: url={task.url}") if task.type == 'dl': self._workers[task.url] = Downloader(self._disk, task, Callback) self.mgr_msg.emit(f"准备下载:{task.name}", 0)