From c6b70e0980c3a547237c34dd7e90a2b41719a44c Mon Sep 17 00:00:00 2001 From: keithsterling Date: Sun, 21 May 2017 20:37:29 +0100 Subject: [PATCH] Renamed json, yaml and xml files to handle module conflict clash --- bots/y-bot/tests/core/datetime_convo.tests | 14 ++++++++++++++ src/programy/config/file/factory.py | 6 +++--- src/programy/config/file/{json.py => json_file.py} | 1 - src/programy/config/file/{xml.py => xml_file.py} | 0 src/programy/config/file/{yaml.py => yaml_file.py} | 0 src/test/config/client/test_client.py | 2 +- src/test/config/client/test_facebook.py | 2 +- src/test/config/client/test_rest.py | 2 +- src/test/config/client/test_twitter.py | 2 +- src/test/config/client/test_webchat.py | 2 +- src/test/config/client/test_xmpp.py | 2 +- src/test/config/file/test_json.py | 2 +- src/test/config/file/test_xml.py | 2 +- src/test/config/file/test_yaml.py | 2 +- src/test/config/test_bot.py | 2 +- src/test/config/test_brain.py | 2 +- 16 files changed, 28 insertions(+), 15 deletions(-) rename src/programy/config/file/{json.py => json_file.py} (99%) rename src/programy/config/file/{xml.py => xml_file.py} (100%) rename src/programy/config/file/{yaml.py => yaml_file.py} (100%) diff --git a/bots/y-bot/tests/core/datetime_convo.tests b/bots/y-bot/tests/core/datetime_convo.tests index dea2837f5..0de4f7080 100644 --- a/bots/y-bot/tests/core/datetime_convo.tests +++ b/bots/y-bot/tests/core/datetime_convo.tests @@ -24,18 +24,24 @@ # WHAT # DAY # "WHAT DAY", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" +"WHAT DAY IS IT TODAY", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" +"TELL ME WHAT DAY IT IS", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" # WHICH # DAY # "WHICH DAY", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" +"WHICH DAY IS IT TODAY", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" +"TELL ME WHICH DAY IT IS", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" # TODAY "TODAY", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" # WHAT # TODAY "WHAT TODAY", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" +"WHAT DAY IS IT TODAY", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" # WHAT # DAY # TOMORROW "WHAT DAY TOMORROW", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" +"WHAT DAY IS TOMORROW", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" # WHAT IS TOMORROW "WHAT DAY IS TOMORROW", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" @@ -45,12 +51,20 @@ # WHAT # YEAR # "WHAT YEAR", "20[0-9][0-9]" +"WHAT IS THE YEAR", "20[0-9][0-9]" +"TELL ME WHAT YEAR", "20[0-9][0-9]" # WHICH # YEAR # "WHICH YEAR", "20[0-9][0-9]" +"WHICH IS THE YEAR", "20[0-9][0-9]" +"TELL ME WHICH YEAR", "20[0-9][0-9]" # WHAT # TODAYS DATE # +"WHAT IS TODAYS DATE", ""Today is *. [0-9]{2},[0-9]{4}" # WHAT # DATE # +"WHAT IS THE DATE", ""Today is *. [0-9]{2},[0-9]{4}" # WHAT # TIME # +"WHAT IS THE TIME", "The time is [0-9]{2}:[0-9]{2} [AM|PM]" +"WHAT TIME IS IT", "The time is [0-9]{2}:[0-9]{2} [AM|PM]" \ No newline at end of file diff --git a/src/programy/config/file/factory.py b/src/programy/config/file/factory.py index 48a3746fe..6683deedf 100644 --- a/src/programy/config/file/factory.py +++ b/src/programy/config/file/factory.py @@ -14,9 +14,9 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -from programy.config.file.xml import XMLConfigurationFile -from programy.config.file.yaml import YamlConfigurationFile -from programy.config.file.json import JSONConfigurationFile +from programy.config.file.xml_file import XMLConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile +from programy.config.file.json_file import JSONConfigurationFile class ConfigurationFactory(object): diff --git a/src/programy/config/file/json.py b/src/programy/config/file/json_file.py similarity index 99% rename from src/programy/config/file/json.py rename to src/programy/config/file/json_file.py index c9047be9f..5fcca22d0 100644 --- a/src/programy/config/file/json.py +++ b/src/programy/config/file/json_file.py @@ -15,7 +15,6 @@ """ import json -import yaml import logging from programy.config.file.file import BaseConfigurationFile diff --git a/src/programy/config/file/xml.py b/src/programy/config/file/xml_file.py similarity index 100% rename from src/programy/config/file/xml.py rename to src/programy/config/file/xml_file.py diff --git a/src/programy/config/file/yaml.py b/src/programy/config/file/yaml_file.py similarity index 100% rename from src/programy/config/file/yaml.py rename to src/programy/config/file/yaml_file.py diff --git a/src/test/config/client/test_client.py b/src/test/config/client/test_client.py index a0676c047..5a016972d 100644 --- a/src/test/config/client/test_client.py +++ b/src/test/config/client/test_client.py @@ -1,5 +1,5 @@ import unittest -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration from programy.config.brain import BrainFileConfiguration diff --git a/src/test/config/client/test_facebook.py b/src/test/config/client/test_facebook.py index c9e01f0cd..a87efa9d0 100644 --- a/src/test/config/client/test_facebook.py +++ b/src/test/config/client/test_facebook.py @@ -1,6 +1,6 @@ import unittest -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration from programy.config.client.facebook import FacebookConfiguration, FacebookClientConfiguration diff --git a/src/test/config/client/test_rest.py b/src/test/config/client/test_rest.py index 09a4ee11c..fa8f98e37 100644 --- a/src/test/config/client/test_rest.py +++ b/src/test/config/client/test_rest.py @@ -1,7 +1,7 @@ import unittest from programy.config.client.rest import RestConfiguration -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration from programy.config.client.rest import RestClientConfiguration diff --git a/src/test/config/client/test_twitter.py b/src/test/config/client/test_twitter.py index dc2034623..4ad7e04b5 100644 --- a/src/test/config/client/test_twitter.py +++ b/src/test/config/client/test_twitter.py @@ -1,6 +1,6 @@ import unittest -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration from programy.config.client.twitter import TwitterConfiguration, TwitterClientConfiguration diff --git a/src/test/config/client/test_webchat.py b/src/test/config/client/test_webchat.py index d4d35aaa2..d0db38043 100644 --- a/src/test/config/client/test_webchat.py +++ b/src/test/config/client/test_webchat.py @@ -1,7 +1,7 @@ import unittest from programy.config.client.webchat import WebChatConfiguration -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration from programy.config.client.webchat import WebChatClientConfiguration diff --git a/src/test/config/client/test_xmpp.py b/src/test/config/client/test_xmpp.py index 345f4ddac..132dbf476 100644 --- a/src/test/config/client/test_xmpp.py +++ b/src/test/config/client/test_xmpp.py @@ -1,6 +1,6 @@ import unittest -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration from programy.config.client.xmpp import XmppConfiguration, XmppClientConfiguration diff --git a/src/test/config/file/test_json.py b/src/test/config/file/test_json.py index 70d57123a..0549892e7 100644 --- a/src/test/config/file/test_json.py +++ b/src/test/config/file/test_json.py @@ -1,7 +1,7 @@ import unittest import os -from programy.config.file.json import JSONConfigurationFile +from programy.config.file.json_file import JSONConfigurationFile from programy.config.client.client import ClientConfiguration diff --git a/src/test/config/file/test_xml.py b/src/test/config/file/test_xml.py index 501b545fb..5a13b2e0d 100644 --- a/src/test/config/file/test_xml.py +++ b/src/test/config/file/test_xml.py @@ -1,7 +1,7 @@ import unittest import os -from programy.config.file.xml import XMLConfigurationFile +from programy.config.file.xml_file import XMLConfigurationFile from programy.config.client.client import ClientConfiguration diff --git a/src/test/config/file/test_yaml.py b/src/test/config/file/test_yaml.py index 49d15f846..c500b02ba 100644 --- a/src/test/config/file/test_yaml.py +++ b/src/test/config/file/test_yaml.py @@ -1,7 +1,7 @@ import unittest import os -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration class YamlConfigurationFileTests(unittest.TestCase): diff --git a/src/test/config/test_bot.py b/src/test/config/test_bot.py index 74c072604..587ca9346 100644 --- a/src/test/config/test_bot.py +++ b/src/test/config/test_bot.py @@ -1,7 +1,7 @@ import unittest from programy.config.bot import BotConfiguration -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration diff --git a/src/test/config/test_brain.py b/src/test/config/test_brain.py index 0169b18d6..b6ca3ac40 100644 --- a/src/test/config/test_brain.py +++ b/src/test/config/test_brain.py @@ -3,7 +3,7 @@ from programy.config.brain import BrainFileConfiguration from programy.config.brain import BrainServiceConfiguration from programy.config.brain import BrainConfiguration -from programy.config.file.yaml import YamlConfigurationFile +from programy.config.file.yaml_file import YamlConfigurationFile from programy.config.client.client import ClientConfiguration