Browse Source

Start to add personality and reviewer modules

Change-Id: I687e810cf5e4c4d6212caa32a2ff659da4d34d8f
Joshua Harlow 3 years ago
parent
commit
8e553811e4
3 changed files with 66 additions and 1 deletions
  1. 26
    0
      nerdreviewer/personality.py
  2. 39
    0
      nerdreviewer/reviewer.py
  3. 1
    1
      requirements.txt

+ 26
- 0
nerdreviewer/personality.py View File

@@ -0,0 +1,26 @@
1
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#    not use this file except in compliance with the License. You may obtain
3
+#    a copy of the License at
4
+#
5
+#         http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#    Unless required by applicable law or agreed to in writing, software
8
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#    License for the specific language governing permissions and limitations
11
+#    under the License.
12
+
13
+import enum
14
+
15
+
16
+class Mood(enum.Enum):
17
+    """Mood component of a reviewer."""
18
+
19
+    MEAN = "MEAN"
20
+    CARING = "CARING"
21
+    HAPPY = "HAPPY"
22
+    SLOTH = "SLOTH"
23
+    COMPLACENT = "COMPLACENT"
24
+    CAFFEINATED = "CAFFEINATED"
25
+    BUSY = "BUSY"
26
+    ANXIOUS = "ANXIOUS"

+ 39
- 0
nerdreviewer/reviewer.py View File

@@ -0,0 +1,39 @@
1
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#    not use this file except in compliance with the License. You may obtain
3
+#    a copy of the License at
4
+#
5
+#         http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#    Unless required by applicable law or agreed to in writing, software
8
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#    License for the specific language governing permissions and limitations
11
+#    under the License.
12
+
13
+import abc
14
+
15
+import six
16
+
17
+
18
+@six.add_metaclass(abc.ABCMeta)
19
+class Reviewer(object):
20
+
21
+    def __init__(self, name=u"John Doe"):
22
+        self._name = name
23
+
24
+    @property
25
+    def name(self):
26
+        """Name of this reviewer (if any)."""
27
+        return self._name
28
+
29
+    @abc.abstractmethod
30
+    def review(self, a_review):
31
+        """Review some incoming review and return its analysis."""
32
+
33
+    @abc.abstractproperty
34
+    def description(self):
35
+        """Useful description of this reviewer (personality, type...)."""
36
+
37
+    @abc.abstractproperty
38
+    def personality(self):
39
+        """Current personality profile/dict of this reviewer"""

+ 1
- 1
requirements.txt View File

@@ -4,9 +4,9 @@
4 4
 
5 5
 pbr>=1.6 # Apache-2.0
6 6
 paramiko>=1.13.0 # LGPL
7
+enum34;python_version=='2.7' or python_version=='2.6' or python_version=='3.3' # BSD
7 8
 jsonschema>=2.0.0,<3.0.0,!=2.5.0 # MIT
8 9
 netaddr>=0.7.12,!=0.7.16 # BSD
9 10
 notifier>=1.0.3 # Apache-2.0
10
-PyYAML>=3.1.0
11 11
 sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 # BSD
12 12
 six>=1.9.0

Loading…
Cancel
Save