From 644ff12c4522d53a1cfd47e9e21a2a8fa9ef3d5b Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Mon, 21 Jul 2014 17:27:53 +0800 Subject: [PATCH] Allowing the package to be executed from different entry points --- mdk.py | 39 +++++++++++++++++++++++++++++++++++++++ mdk/{mdk.py => __main__.py} | 0 2 files changed, 39 insertions(+) create mode 100755 mdk.py rename mdk/{mdk.py => __main__.py} (100%) mode change 100755 => 100644 diff --git a/mdk.py b/mdk.py new file mode 100755 index 0000000..fb3942e --- /dev/null +++ b/mdk.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +Moodle Development Kit + +Copyright (c) 2013 Frédéric Massart - FMCorz.net + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +http://github.com/FMCorz/mdk +""" + +""" +This file executes MDK as a package. + +It is intended to be used by those who are not using MDK as a package, +they can make this file executable and execute it directly. + +Is also provides backwards compatibility to those who had set up MDK manually +by cloning the repository and linked to mdk.py as an executable. + +Please note that using this method is not advised, using `python -m mdk` or the +executable installed with the package is recommended. +""" + +import runpy +runpy.run_module('mdk') diff --git a/mdk/mdk.py b/mdk/__main__.py old mode 100755 new mode 100644 similarity index 100% rename from mdk/mdk.py rename to mdk/__main__.py -- 2.11.0