From 12db43fcf37c05734ebca295f2e0d04121c445eb Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sun, 17 Jan 2016 12:11:07 -0800 Subject: [PATCH] Begin to add initial scanner modules Change-Id: I3fba1cd83723c2787e67dca641b8907abbd577bf --- nerdreviewer/scanners/__init__.py | 0 nerdreviewer/scanners/speller.py | 27 +++++++++++++++++++++++++++ requirements.txt | 1 + 3 files changed, 28 insertions(+) create mode 100644 nerdreviewer/scanners/__init__.py create mode 100644 nerdreviewer/scanners/speller.py diff --git a/nerdreviewer/scanners/__init__.py b/nerdreviewer/scanners/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/nerdreviewer/scanners/speller.py b/nerdreviewer/scanners/speller.py new file mode 100644 index 0000000..be8fee0 --- /dev/null +++ b/nerdreviewer/scanners/speller.py @@ -0,0 +1,27 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from oslo_utils import importutils + +enchant = importutils.try_import("enchant") + + +class Scanner(object): + version = "0.1" + + @staticmethod + def is_available(): + return enchant is not None + + @staticmethod + def scan_for_problems(review): + return [] diff --git a/requirements.txt b/requirements.txt index e8b35b7..4cae908 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ pbr>=1.6 # Apache-2.0 paramiko>=1.13.0 # LGPL +oslo.utils>=3.2.0 # Apache-2.0 enum34;python_version=='2.7' or python_version=='2.6' or python_version=='3.3' # BSD jsonschema>=2.0.0,<3.0.0,!=2.5.0 # MIT netaddr>=0.7.12,!=0.7.16 # BSD