瀏覽代碼

Fix some exceptions

tags/v0.1^2
Ben Kurtovic 12 年之前
父節點
當前提交
e5371681c0
共有 5 個檔案被更改,包括 11 行新增6 行删除
  1. +2
    -1
      earwigbot/commands/editcount.py
  2. +2
    -1
      earwigbot/commands/registration.py
  3. +2
    -1
      earwigbot/commands/rights.py
  4. +2
    -1
      earwigbot/tasks/__init__.py
  5. +3
    -2
      earwigbot/tasks/afc_statistics.py

+ 2
- 1
earwigbot/commands/editcount.py 查看文件

@@ -22,6 +22,7 @@

from urllib import quote_plus

from earwigbot import exceptions
from earwigbot import wiki
from earwigbot.commands import BaseCommand

@@ -46,7 +47,7 @@ class Command(BaseCommand):

try:
count = user.editcount
except wiki.UserNotFoundError:
except earwigbot.UserNotFoundError:
msg = "the user \x0302{0}\x0301 does not exist."
self.reply(data, msg.format(name))
return


+ 2
- 1
earwigbot/commands/registration.py 查看文件

@@ -22,6 +22,7 @@

import time

from earwigbot import exceptions
from earwigbot import wiki
from earwigbot.commands import BaseCommand

@@ -46,7 +47,7 @@ class Command(BaseCommand):

try:
reg = user.registration
except wiki.UserNotFoundError:
except exceptions.UserNotFoundError:
msg = "the user \x0302{0}\x0301 does not exist."
self.reply(data, msg.format(name))
return


+ 2
- 1
earwigbot/commands/rights.py 查看文件

@@ -20,6 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from earwigbot import exceptions
from earwigbot import wiki
from earwigbot.commands import BaseCommand

@@ -44,7 +45,7 @@ class Command(BaseCommand):

try:
rights = user.groups
except wiki.UserNotFoundError:
except exceptions.UserNotFoundError:
msg = "the user \x0302{0}\x0301 does not exist."
self.reply(data, msg.format(name))
return


+ 2
- 1
earwigbot/tasks/__init__.py 查看文件

@@ -20,6 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from earwigbot import exceptions
from earwigbot import wiki

__all__ = ["BaseTask"]
@@ -122,7 +123,7 @@ class BaseTask(object):

try:
content = page.get()
except wiki.PageNotFoundError:
except exceptions.PageNotFoundError:
return False
if content == cfg.get("disabled", "run"):
return False


+ 3
- 2
earwigbot/tasks/afc_statistics.py 查看文件

@@ -28,6 +28,7 @@ from time import sleep

import oursql

from earwigbot import exceptions
from earwigbot import wiki
from earwigbot.tasks import BaseTask

@@ -470,7 +471,7 @@ class Task(BaseTask):
else:
try:
ns = self.site.namespace_name_to_id(namespace)
except wiki.NamespaceNotFoundError:
except exceptions.NamespaceNotFoundError:
base = title
ns = wiki.NS_MAIN

@@ -720,7 +721,7 @@ class Task(BaseTask):
try:
if submitter.blockinfo:
notes += "|nb=1" # Submitter is blocked
except wiki.UserNotFoundError: # Likely an IP
except exceptions.UserNotFoundError: # Likely an IP
pass

return notes

Loading…
取消
儲存