Skip to content

Commit

Permalink
Update fstring syntax #87
Browse files Browse the repository at this point in the history
  • Loading branch information
rachpt committed Jan 31, 2021
1 parent a85c9d1 commit 9ce9af8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lanzou/api/core.py
Expand Up @@ -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 的文件
Expand Down
10 changes: 5 additions & 5 deletions lanzou/gui/workers/manager.py
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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

Expand All @@ -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]
# 发送所有任务完成信号
Expand Down Expand Up @@ -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"准备下载:<font color='#FFA500'>{task.name}</font>", 0)
Expand Down

0 comments on commit 9ce9af8

Please sign in to comment.