浏览代码

Mod thread.ident by 10,000 for when they're absurdly large.

tags/v0.2
Ben Kurtovic 10 年前
父节点
当前提交
e67833a39f
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. +3
    -3
      earwigbot/commands/threads.py

+ 3
- 3
earwigbot/commands/threads.py 查看文件

@@ -71,10 +71,10 @@ class Threads(Command):
tname = thread.name
if tname == "MainThread":
t = "\x0302MainThread\x0F (id {0})"
normal_threads.append(t.format(thread.ident))
normal_threads.append(t.format(thread.ident % 10000))
elif tname in self.config.components:
t = "\x0302{0}\x0F (id {1})"
normal_threads.append(t.format(tname, thread.ident))
normal_threads.append(t.format(tname, thread.ident % 10000))
elif tname.startswith("reminder"):
tname = tname.replace("reminder ", "")
t = "\x0302reminder\x0F (until {0})"
@@ -82,7 +82,7 @@ class Threads(Command):
else:
tname, start_time = re.findall("^(.*?) \((.*?)\)$", tname)[0]
t = "\x0302{0}\x0F (id {1}, since {2})"
daemon_threads.append(t.format(tname, thread.ident,
daemon_threads.append(t.format(tname, thread.ident % 10000,
start_time))

if daemon_threads:


正在加载...
取消
保存