Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
Revision history for the Python package RiveScript.

1.13.0 TBD
- Restructure the code to keep it on par with the JavaScript and Go versions:
- `rivescript.parser` now contains all the parsing code:
`parse()` and `check_syntax()` are moved here.
- Refactor the RiveScript interactive mode (`rivescript.interactive`) to use
argparse instead of getopt and add a pretty ASCII logo.
- Add `shell.py` as a possibly easier-to-access (and certainly
easier-to-discover) shortcut to running RiveScript's interactive mode.

1.12.3 Jul 8 2016
- Fix the Python object macro handler to use `six.text_type` on the return
value, allowing Python 2 objects to return Unicode strings.
Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
all: build

build:
python setup.py build

install:
python setup.py install

test:
pip install -r requirements.txt
nosetests

clean:
rm -rf build dist rivescript.egg-info
find . -name '*.pyc' -delete

.PHONY: build install test clean
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ interactive chat session:

python rivescript ./eg/brain

In case running RiveScript as a script is inconvenient (for example, when it's
installed as a system module) you can use the `shell.py` script as an alias:

python shell.py eg/brain

When used as a library, the synopsis is as follows:

```python
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
55 changes: 55 additions & 0 deletions docs/rivescript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ rivescript.rivescript module
:undoc-members:
:show-inheritance:

rivescript.brain module
-----------------------

.. automodule:: rivescript.brain
:members:
:undoc-members:
:show-inheritance:

rivescript.exceptions module
----------------------------

Expand All @@ -20,6 +28,29 @@ rivescript.exceptions module
:undoc-members:
:show-inheritance:

rivescript.inheritance module
-----------------------------

.. automodule:: rivescript.inheritance
:members:
:undoc-members:
:show-inheritance:

rivescript.interactive module
-----------------------------

.. automodule:: rivescript.interactive
:members:
:undoc-members:
:show-inheritance:

rivescript.parser module
------------------------

.. automodule:: rivescript.parser
:members:
:undoc-members:
:show-inheritance:

rivescript.python module
------------------------
Expand All @@ -28,3 +59,27 @@ rivescript.python module
:members:
:undoc-members:
:show-inheritance:

rivescript.regexp module
------------------------

.. automodule:: rivescript.regexp
:members:
:undoc-members:
:show-inheritance:

rivescript.sorting module
-------------------------

.. automodule:: rivescript.sorting
:members:
:undoc-members:
:show-inheritance:

rivescript.utils module
-----------------------

.. automodule:: rivescript.utils
:members:
:undoc-members:
:show-inheritance:
4 changes: 0 additions & 4 deletions mkdocs.sh

This file was deleted.

36 changes: 10 additions & 26 deletions rivescript/__init__.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
#!/usr/bin/env python

# pyRiveScript - A RiveScript interpreter written in Python.

# The MIT License (MIT)
#
# Copyright (c) 2016 Noah Petherbridge
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# RiveScript-Python
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# This code is released under the MIT License.
# See the "LICENSE" file for more information.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# https://www.rivescript.com/

# Python 3 compat
from __future__ import print_function, unicode_literals
Expand All @@ -39,7 +20,10 @@
__docformat__ = 'plaintext'

__all__ = ['rivescript']
__version__ = '1.12.3'
__version__ = '1.12.4'

from .rivescript import RiveScript, RiveScriptError, NoMatchError, NoReplyError,\
ObjectError, DeepRecursionError, NoDefaultRandomTopicError, RepliesNotSortedError
from .rivescript import RiveScript
from .exceptions import (
RiveScriptError, NoMatchError, NoReplyError, ObjectError,
DeepRecursionError, NoDefaultRandomTopicError, RepliesNotSortedError
)
25 changes: 4 additions & 21 deletions rivescript/__main__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
#!/usr/bin/env python

# The MIT License (MIT)
#
# Copyright (c) 2016 Noah Petherbridge
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# RiveScript-Python
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# This code is released under the MIT License.
# See the "LICENSE" file for more information.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# https://www.rivescript.com/

from __future__ import absolute_import, unicode_literals

Expand Down
Loading