From 9eedfd33eeaf337e59fc260d393273d2e04a7844 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Sun, 27 Feb 2022 09:22:43 +0800 Subject: [PATCH] Allow hyphens in Fandom URL validator Some Fandom book URL contains hyphen, for example, darren-shan.fandom.com and diary-of-a-wimpy-kid.fandom.com --- __init__.py | 2 +- config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 384980b..8308785 100644 --- a/__init__.py +++ b/__init__.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from calibre.customize import InterfaceActionBase -VERSION = (3, 18, 2) +VERSION = (3, 18, 3) class WordDumbDumb(InterfaceActionBase): diff --git a/config.py b/config.py index c4f756c..6682d9d 100644 --- a/config.py +++ b/config.py @@ -73,7 +73,7 @@ def __init__(self): self.fandom_url = QLineEdit() self.fandom_url.setText(prefs['fandom']) self.fandom_url.setPlaceholderText('https://x.fandom.com') - fandom_re = QRegularExpression(r'https:\/\/\w+\.fandom\.com') + fandom_re = QRegularExpression(r'https:\/\/[\w-]+\.fandom\.com') fandom_validator = QRegularExpressionValidator(fandom_re) self.fandom_url.setValidator(fandom_validator) fandom_hl.addWidget(self.fandom_url)