From 82809e77a3d42d77e6b3bf37653e538ea8eff0be Mon Sep 17 00:00:00 2001 From: Fred Date: Sat, 18 May 2013 21:05:24 +0800 Subject: [PATCH] Write deprecated message to stderr --- moodle-alias.py | 9 +++++---- moodle-backport.py | 9 +++++---- moodle-backup.py | 9 +++++---- moodle-behat.py | 9 +++++---- moodle-check.py | 9 +++++---- moodle-config.py | 9 +++++---- moodle-create.py | 9 +++++---- moodle-fix.py | 9 +++++---- moodle-info.py | 9 +++++---- moodle-init.py | 9 +++++---- moodle-install.py | 9 +++++---- moodle-phpunit.py | 9 +++++---- moodle-pull.py | 9 +++++---- moodle-purge.py | 9 +++++---- moodle-push.py | 9 +++++---- moodle-rebase.py | 9 +++++---- moodle-remove.py | 9 +++++---- moodle-run.py | 9 +++++---- moodle-update.py | 9 +++++---- moodle-upgrade.py | 9 +++++---- 20 files changed, 100 insertions(+), 80 deletions(-) diff --git a/moodle-alias.py b/moodle-alias.py index a5c44ef..f26aa02 100755 --- a/moodle-alias.py +++ b/moodle-alias.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-backport.py b/moodle-backport.py index a5c44ef..f26aa02 100755 --- a/moodle-backport.py +++ b/moodle-backport.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-backup.py b/moodle-backup.py index a5c44ef..f26aa02 100755 --- a/moodle-backup.py +++ b/moodle-backup.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-behat.py b/moodle-behat.py index a5c44ef..f26aa02 100755 --- a/moodle-behat.py +++ b/moodle-behat.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-check.py b/moodle-check.py index a5c44ef..f26aa02 100755 --- a/moodle-check.py +++ b/moodle-check.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-config.py b/moodle-config.py index a5c44ef..f26aa02 100755 --- a/moodle-config.py +++ b/moodle-config.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-create.py b/moodle-create.py index a5c44ef..f26aa02 100755 --- a/moodle-create.py +++ b/moodle-create.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-fix.py b/moodle-fix.py index a5c44ef..f26aa02 100755 --- a/moodle-fix.py +++ b/moodle-fix.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-info.py b/moodle-info.py index a5c44ef..f26aa02 100755 --- a/moodle-info.py +++ b/moodle-info.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-init.py b/moodle-init.py index a5c44ef..f26aa02 100755 --- a/moodle-init.py +++ b/moodle-init.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-install.py b/moodle-install.py index a5c44ef..f26aa02 100755 --- a/moodle-install.py +++ b/moodle-install.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-phpunit.py b/moodle-phpunit.py index a5c44ef..f26aa02 100755 --- a/moodle-phpunit.py +++ b/moodle-phpunit.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-pull.py b/moodle-pull.py index 735caef..e033045 100755 --- a/moodle-pull.py +++ b/moodle-pull.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-purge.py b/moodle-purge.py index a5c44ef..f26aa02 100755 --- a/moodle-purge.py +++ b/moodle-purge.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-push.py b/moodle-push.py index a5c44ef..f26aa02 100755 --- a/moodle-push.py +++ b/moodle-push.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-rebase.py b/moodle-rebase.py index a5c44ef..f26aa02 100755 --- a/moodle-rebase.py +++ b/moodle-rebase.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-remove.py b/moodle-remove.py index a5c44ef..f26aa02 100755 --- a/moodle-remove.py +++ b/moodle-remove.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-run.py b/moodle-run.py index a5c44ef..f26aa02 100755 --- a/moodle-run.py +++ b/moodle-run.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-update.py b/moodle-update.py index a5c44ef..f26aa02 100755 --- a/moodle-update.py +++ b/moodle-update.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) diff --git a/moodle-upgrade.py b/moodle-upgrade.py index a5c44ef..f26aa02 100755 --- a/moodle-upgrade.py +++ b/moodle-upgrade.py @@ -22,16 +22,17 @@ along with this program. If not, see . http://github.com/FMCorz/mdk """ +import sys from os.path import basename from lib.command import CommandRunner from lib.commands import getCommand from lib.config import Conf f = basename(__file__) -print "Do not call %s directly." % (f) -print "This file will be removed in a later version." -print "Please use `mdk [command] [arguments]`" -print "" +sys.stderr.write("Do not call %s directly.\n" % (f)) +sys.stderr.write("This file will be removed in a later version.\n") +sys.stderr.write("Please use `mdk [command] [arguments]`\n") +sys.stderr.write("\n") cmd = f.replace('moodle-', '').replace('.py', '') cls = getCommand(cmd) -- 2.11.0