From e4f2cda3727b20c7c04ef4ed72155d70a34ad1a6 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Dec 01 2016 01:51:32 +0000 Subject: Remove unnecessary entry point Entry point has been moved to __main__.py, so remove the duplicate and unused same code from cli.py. Signed-off-by: Chenxiong Qi --- diff --git a/fedpkg/__main__.py b/fedpkg/__main__.py index e46c418..6c7e078 100644 --- a/fedpkg/__main__.py +++ b/fedpkg/__main__.py @@ -85,5 +85,6 @@ def main(): raise sys.exit(1) + if __name__ == "__main__": main() diff --git a/fedpkg/cli.py b/fedpkg/cli.py index 364afe0..5fd2217 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -10,9 +10,7 @@ # the full text of the license. from pyrpkg.cli import cliClient -import sys import os -import logging import re import textwrap import hashlib @@ -172,36 +170,3 @@ suggest_reboot=False # Clean up os.unlink('bodhi.template') os.unlink('clog') - -if __name__ == '__main__': - client = cliClient() - client._do_imports() - client.parse_cmdline() - - if not client.args.path: - try: - client.args.path = os.getcwd() - except: - print('Could not get current path, have you deleted it?') - sys.exit(1) - - # setup the logger -- This logger will take things of INFO or DEBUG and - # log it to stdout. Anything above that (WARN, ERROR, CRITICAL) will go - # to stderr. Normal operation will show anything INFO and above. - # Quiet hides INFO, while Verbose exposes DEBUG. In all cases WARN or - # higher are exposed (via stderr). - log = client.site.log - client.setupLogging(log) - - if client.args.v: - log.setLevel(logging.DEBUG) - elif client.args.q: - log.setLevel(logging.WARNING) - else: - log.setLevel(logging.INFO) - - # Run the necessary command - try: - client.args.command() - except KeyboardInterrupt: - pass