Skip to content

Commit 5c2aa86

Browse files
committed
Simple PEP8 changes
1 parent 6ab4fc7 commit 5c2aa86

3 files changed

Lines changed: 87 additions & 82 deletions

File tree

rivescript/interactive.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717

1818
from rivescript import RiveScript
1919

20+
2021
# Compatible wrapper for inputs.
2122
def _input(prompt=None):
2223
if sys.version_info[0] < 3:
2324
return raw_input(prompt)
2425
else:
2526
return input(prompt)
2627

28+
2729
def json_in(bot, buffer, stateful):
2830
# Prepare the response.
2931
resp = {
@@ -66,6 +68,7 @@ def json_in(bot, buffer, stateful):
6668
if stateful:
6769
print("__END__")
6870

71+
6972
def interactive_mode():
7073
# Get command line options.
7174
options, remainder = [], []
@@ -102,7 +105,7 @@ def interactive_mode():
102105
elif opt[0] == '--depth':
103106
depth = int(opt[1])
104107
elif opt[0] == '--log':
105-
log = opt[1]
108+
log = opt[1]
106109

107110
# Help?
108111
if help:
@@ -193,7 +196,7 @@ def interactive_mode():
193196
end = re.match(r'^__END__$', line)
194197
if end:
195198
# Process it.
196-
stateful = True # This is a stateful session
199+
stateful = True # This is a stateful session
197200
json_in(bot, buffer, stateful)
198201
buffer = ""
199202
continue

rivescript/python.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
__docformat__ = 'plaintext'
77

8+
89
class PyRiveObjects:
910
"""A RiveScript object handler for Python code.
1011
@@ -28,7 +29,7 @@ class PyRiveObjects:
2829
handler on your RiveScript object:
2930
3031
rs.set_handler("python", None)"""
31-
_objects = {} # The cache of objects loaded
32+
_objects = {} # The cache of objects loaded
3233

3334
def __init__(self):
3435
pass
@@ -52,11 +53,11 @@ def load(self, name, code):
5253
def call(self, rs, name, user, fields):
5354
"""Invoke a previously loaded object."""
5455
# Call the dynamic method.
55-
func = self._objects[name]
56+
func = self._objects[name]
5657
reply = ''
5758
try:
5859
reply = func(rs, fields)
59-
if reply == None:
60+
if reply is None:
6061
reply = ''
6162
except Exception as e:
6263
print("Error executing Python object:", e)

0 commit comments

Comments
 (0)