diff options
Diffstat (limited to 'cgi/anarkia.py')
-rw-r--r-- | cgi/anarkia.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/cgi/anarkia.py b/cgi/anarkia.py index de9152f..ad64596 100644 --- a/cgi/anarkia.py +++ b/cgi/anarkia.py @@ -18,7 +18,7 @@ def anarkia(self, path_split): self.output = main() return - raise UserError, 'Ya fue, baisano...' + raise UserError('Ya fue, baisano...') if path_split[2] == 'opt': self.output = boardoptions(self.formdata) @@ -33,7 +33,7 @@ def anarkia(self, path_split): elif path_split[2] == 'emojis': self.output = emojis(self.formdata) else: - raise UserError, 'ke?' + raise UserError('ke?') def main(): @@ -90,7 +90,7 @@ def type(formdata): logAction(msg) return renderTemplate('anarkia.html', {'mode': 99, 'msg': msg}) else: - raise UserError, 'Esta acción sólo se puede realizar cada 10 minutos. Faltan: %d mins.' % (10-int(dif/60)) + raise UserError('Esta acción sólo se puede realizar cada 10 minutos. Faltan: %d mins.' % (10-int(dif/60))) return renderTemplate('anarkia.html', {'mode': 7, 'type_now': type_now, 'type_do': type_do}) @@ -203,9 +203,9 @@ def bans(formdata): ban = FetchOne("SELECT * FROM `bans` WHERE id = %d" % unban) if not ban: - raise UserError, "Ban inválido." + raise UserError("Ban inválido.") if ban['boards'] != boardpickle: - raise USerError, "Ban inválido." + raise USerError("Ban inválido.") UpdateDb('DELETE FROM `bans` WHERE id = %s' % ban['id']) logAction("Usuario %s desbaneado." % ban['ip'][:4]) @@ -255,7 +255,7 @@ def mod(formdata): logAction(msg) return renderTemplate('anarkia.html', {'mode': 99, 'msg': msg}) else: - raise UserError, "jaj no" + raise UserError("jaj no") elif formdata.get('restore'): postid = int(formdata['restore']) post = FetchOne('SELECT id, parentid FROM posts WHERE boardid = %s AND id = %d LIMIT 1' % ( @@ -293,7 +293,7 @@ def mod(formdata): ban = FetchOne("SELECT `id` FROM `bans` WHERE `ip` = '" + post['ip'] + "' AND `boards` = '" + _mysql.escape_string(where) + "' LIMIT 1") if ban: - raise UserError, "Este usuario ya esta baneado." + raise UserError("Este usuario ya esta baneado.") # Blind mode if formdata.get('blind') == '1': @@ -339,23 +339,23 @@ def boardoptions(formdata): board['subject'] = formdata['subject'].replace('script', '') board['message'] = formdata['message'].replace('script', '') board['useid'] = formdata['useid'] - if 'disable_name' in formdata.keys(): + if 'disable_name' in formdata: board['disable_name'] = '1' else: board['disable_name'] = '0' - if 'disable_subject' in formdata.keys(): + if 'disable_subject' in formdata: board['disable_subject'] = '1' else: board['disable_subject'] = '0' - if 'allow_noimage' in formdata.keys(): + if 'allow_noimage' in formdata: board['allow_noimage'] = '1' else: board['allow_noimage'] = '0' - if 'allow_images' in formdata.keys(): + if 'allow_images' in formdata: board['allow_images'] = '1' else: board['allow_images'] = '0' - if 'allow_image_replies' in formdata.keys(): + if 'allow_image_replies' in formdata: board['allow_image_replies'] = '1' else: board['allow_image_replies'] = '0' @@ -364,7 +364,7 @@ def boardoptions(formdata): UpdateDb("DELETE FROM `boards_filetypes` WHERE `boardid` = %s" % board['id']) for filetype in filetypelist(): - if 'filetype'+filetype['ext'] in formdata.keys(): + if 'filetype'+filetype['ext'] in formdata: UpdateDb("INSERT INTO `boards_filetypes` VALUES (%s, %s)" % (board['id'], filetype['id'])) @@ -373,28 +373,28 @@ def boardoptions(formdata): if board['maxsize'] > 10000: board['maxsize'] = 10000 except: - raise UserError, _("Max size must be numeric.") + raise UserError(_("Max size must be numeric.")) try: board['thumb_px'] = int(formdata['thumb_px']) if board['thumb_px'] > 500: board['thumb_px'] = 500 except: - raise UserError, _("Max thumb dimensions must be numeric.") + raise UserError(_("Max thumb dimensions must be numeric.")) try: board['numthreads'] = int(formdata['numthreads']) if board['numthreads'] > 15: board['numthreads'] = 15 except: - raise UserError, _("Max threads shown must be numeric.") + raise UserError(_("Max threads shown must be numeric.")) try: board['numcont'] = int(formdata['numcont']) if board['numcont'] > 15: board['numcont'] = 15 except: - raise UserError, _("Max replies shown must be numeric.") + raise UserError(_("Max replies shown must be numeric.")) t = time.time() updateBoardSettings() |