瀏覽代碼

Simplify a bit of code in Page

tags/v0.1^2
Ben Kurtovic 12 年之前
父節點
當前提交
c0e309bbd9
共有 1 個檔案被更改,包括 2 行新增9 行删除
  1. +2
    -9
      earwigbot/wiki/page.py

+ 2
- 9
earwigbot/wiki/page.py 查看文件

@@ -214,15 +214,8 @@ class Page(CopyvioMixIn):

res = result["query"]["pages"].values()[0]

# Normalize our pagename/title thing:
self._title = res["title"]

try:
res["redirect"]
except KeyError:
self._is_redirect = False
else:
self._is_redirect = True
self._title = res["title"] # Normalize our pagename/title
self._is_redirect = "redirect" in res

self._pageid = int(result["query"]["pages"].keys()[0])
if self._pageid < 0:


Loading…
取消
儲存