diff --git a/src/base/search/searchpluginmanager.cpp b/src/base/search/searchpluginmanager.cpp index d3f3b0297..c79ba5d60 100644 --- a/src/base/search/searchpluginmanager.cpp +++ b/src/base/search/searchpluginmanager.cpp @@ -523,23 +523,23 @@ void SearchPluginManager::updateNova() packageFile2.close(); // Copy search plugin files (if necessary) - const auto updateFile = [&enginePath](const Path &filename, const bool compareVersion) + const auto updateFile = [&enginePath](const Path &filename) { const Path filePathBundled = Path(u":/searchengine/nova3"_s) / filename; const Path filePathDisk = enginePath / filename; - if (compareVersion && (getPluginVersion(filePathBundled) <= getPluginVersion(filePathDisk))) + if (getPluginVersion(filePathBundled) <= getPluginVersion(filePathDisk)) return; Utils::Fs::removeFile(filePathDisk); Utils::Fs::copyFile(filePathBundled, filePathDisk); }; - updateFile(Path(u"helpers.py"_s), true); - updateFile(Path(u"nova2.py"_s), true); - updateFile(Path(u"nova2dl.py"_s), true); - updateFile(Path(u"novaprinter.py"_s), true); - updateFile(Path(u"socks.py"_s), false); + updateFile(Path(u"helpers.py"_s)); + updateFile(Path(u"nova2.py"_s)); + updateFile(Path(u"nova2dl.py"_s)); + updateFile(Path(u"novaprinter.py"_s)); + updateFile(Path(u"socks.py"_s)); } void SearchPluginManager::update() @@ -680,7 +680,8 @@ PluginVersion SearchPluginManager::getPluginVersion(const Path &filePath) while (!pluginFile.atEnd()) { const auto line = QString::fromUtf8(pluginFile.readLine(lineMaxLength)).remove(u' '); - if (!line.startsWith(u"#VERSION:", Qt::CaseInsensitive)) continue; + if (!line.startsWith(u"#VERSION:", Qt::CaseInsensitive)) + continue; const QString versionStr = line.sliced(9); const auto version = PluginVersion::fromString(versionStr); diff --git a/src/searchengine/nova3/novaprinter.py b/src/searchengine/nova3/novaprinter.py index e5c0b0b74..812b0cd95 100644 --- a/src/searchengine/nova3/novaprinter.py +++ b/src/searchengine/nova3/novaprinter.py @@ -1,4 +1,4 @@ -#VERSION: 1.52 +# VERSION: 1.53 # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -56,7 +56,7 @@ def prettyPrinter(dictionary: SearchResults) -> None: print(outtext, file=utf8stdout) -sizeUnitRegex: re.Pattern[str] = re.compile(r"^(?P\d*\.?\d+) *(?P[a-z]+)?", re.IGNORECASE) +_sizeUnitRegex: re.Pattern[str] = re.compile(r"^(?P\d*\.?\d+) *(?P[a-z]+)?", re.IGNORECASE) # TODO: use `float | int | str` when using Python >= 3.10 @@ -73,7 +73,7 @@ def anySizeToBytes(size_string: Union[float, int, str]) -> int: if isinstance(size_string, float): return round(size_string) - match = sizeUnitRegex.match(size_string.strip()) + match = _sizeUnitRegex.match(size_string.strip()) if match is None: return -1 diff --git a/src/searchengine/nova3/socks.py b/src/searchengine/nova3/socks.py index 88e6a8f8e..8b7ceee69 100644 --- a/src/searchengine/nova3/socks.py +++ b/src/searchengine/nova3/socks.py @@ -1,3 +1,5 @@ +# VERSION: 1.00 + """PySocks - A SOCKS proxy client and wrapper for Python. Version 1.7.1