Selaa lähdekoodia

Fix some exceptions

tags/v0.1^2
Ben Kurtovic 12 vuotta sitten
vanhempi
commit
e5371681c0
5 muutettua tiedostoa jossa 11 lisäystä ja 6 poistoa
  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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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

Ladataan…
Peruuta
Tallenna