Skip to content

Commit

Permalink
Add deprecation wanings
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Jul 19, 2017
1 parent 10fad87 commit ee1dc88
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chatterbot/chatterbot.py
Expand Up @@ -173,6 +173,14 @@ def from_config(cls, config_file_path):
Create a new ChatBot instance from a JSON config file.
"""
import json
import warnings

warnings.warn(
'The from_config method is deprecated and '
'will be removed in ChatterBot version 0.8.',
DeprecationWarning
)

with open(config_file_path, 'r') as config_file:
data = json.load(config_file)

Expand Down
6 changes: 6 additions & 0 deletions chatterbot/storage/jsonfile.py
Expand Up @@ -26,6 +26,12 @@ def __init__(self, **kwargs):
self.UnsuitableForProductionWarning
)

warnings.warn(
'The JsonFileStorageAdapter is deprecated and '
'will be removed in ChatterBot version 0.8.',
DeprecationWarning
)

database_path = self.kwargs.get('database', 'database.db')
self.database = Database(database_path)

Expand Down

0 comments on commit ee1dc88

Please sign in to comment.