From 4631d3dd1db25522d2671e3a2d92c2691f1e8407 Mon Sep 17 00:00:00 2001 From: "Vgr E. Barry" Date: Sat, 13 Aug 2016 11:43:05 -0400 Subject: [PATCH] Set the ground up for static type checking Not yet enforced, but soon, bot owners will be forced to install the typing module. --- requirements.txt | 1 + wolfbot.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c997f36 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +typing diff --git a/wolfbot.py b/wolfbot.py index 6fdfbe3..25b5a9c 100755 --- a/wolfbot.py +++ b/wolfbot.py @@ -19,6 +19,7 @@ import traceback import sys +import os import botconfig @@ -26,6 +27,22 @@ if sys.version_info < (3, 3): print("Python 3.3 or newer is required to run the bot.") sys.exit(1) +try: # need to manually add dependencies here + pass #import typing +except ImportError: + command = "python3" + if os.name == "nt": + command = "py -3" + print("*** Missing dependencies! ***".center(80), + "Please install the missing dependencies by running the following command:", + "{0} -m pip install -r requirements.txt".format(command), "", + "If you don't have pip and don't know how to install it, follow this link:", + "https://pip.pypa.io/en/stable/installing/", "", + "If you need any further help with setting up and/or running the bot, we", + " will be happy to help you in ##werewolf-dev on irc.freenode.net", + "", "- The lykos developers", sep="\n") + sys.exit(1) + from oyoyo.client import IRCClient import src