Start to add personality and reviewer modules
Change-Id: I687e810cf5e4c4d6212caa32a2ff659da4d34d8f
This commit is contained in:
parent
1157e84e79
commit
8e553811e4
26
nerdreviewer/personality.py
Normal file
26
nerdreviewer/personality.py
Normal file
@ -0,0 +1,26 @@
|
||||
# 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.
|
||||
|
||||
import enum
|
||||
|
||||
|
||||
class Mood(enum.Enum):
|
||||
"""Mood component of a reviewer."""
|
||||
|
||||
MEAN = "MEAN"
|
||||
CARING = "CARING"
|
||||
HAPPY = "HAPPY"
|
||||
SLOTH = "SLOTH"
|
||||
COMPLACENT = "COMPLACENT"
|
||||
CAFFEINATED = "CAFFEINATED"
|
||||
BUSY = "BUSY"
|
||||
ANXIOUS = "ANXIOUS"
|
39
nerdreviewer/reviewer.py
Normal file
39
nerdreviewer/reviewer.py
Normal file
@ -0,0 +1,39 @@
|
||||
# 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.
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Reviewer(object):
|
||||
|
||||
def __init__(self, name=u"John Doe"):
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Name of this reviewer (if any)."""
|
||||
return self._name
|
||||
|
||||
@abc.abstractmethod
|
||||
def review(self, a_review):
|
||||
"""Review some incoming review and return its analysis."""
|
||||
|
||||
@abc.abstractproperty
|
||||
def description(self):
|
||||
"""Useful description of this reviewer (personality, type...)."""
|
||||
|
||||
@abc.abstractproperty
|
||||
def personality(self):
|
||||
"""Current personality profile/dict of this reviewer"""
|
@ -4,9 +4,9 @@
|
||||
|
||||
pbr>=1.6 # Apache-2.0
|
||||
paramiko>=1.13.0 # LGPL
|
||||
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
|
||||
notifier>=1.0.3 # Apache-2.0
|
||||
PyYAML>=3.1.0
|
||||
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 # BSD
|
||||
six>=1.9.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user