diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-09-22 19:32:19 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-09-22 20:08:55 +0200 |
commit | f102030e71be1fab7ac33cbdb009c14e501559f1 (patch) | |
tree | cdee1ea2179d5fada65e222aadbf436c77283b3b /__main__.py | |
parent | 226552408f15448307befae32b4a54fec3ae1a29 (diff) | |
download | clufter-f102030e71be1fab7ac33cbdb009c14e501559f1.tar.gz clufter-f102030e71be1fab7ac33cbdb009c14e501559f1.tar.xz clufter-f102030e71be1fab7ac33cbdb009c14e501559f1.zip |
Expose CLI frontend to be runnable via "python -m" syntax
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to '__main__.py')
-rw-r--r-- | __main__.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/__main__.py b/__main__.py new file mode 100644 index 0000000..de1e6c7 --- /dev/null +++ b/__main__.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- +# Copyright 2014 Red Hat, Inc. +# Part of clufter project +# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt) +"""Machinery entry point -- to be run via python -m <package>""" +__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>" + +from os.path import basename +from sys import argv, exit + +from .main import run + +if basename(argv[0]) == '__main__.py': + argv[0] = 'python -m ' + __package__ +exit(run(argv)) |