Make running main.py directly work better

This commit is contained in:
Joshua Harlow 2014-05-24 19:13:47 -07:00
parent a1c37e2213
commit c53e54c6fc
1 changed files with 7 additions and 1 deletions

View File

@ -33,6 +33,12 @@ What is checked:
import argparse
import collections
import os
import sys
if __name__ == '__main__':
# Only useful for when running directly (for dev/debugging).
sys.path.insert(0, os.path.abspath(os.getcwd()))
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, os.getcwd())))
from six.moves import configparser
from stevedore import extension
@ -119,6 +125,7 @@ def fetch_checks(cfg):
def main():
parser = argparse.ArgumentParser(
prog='doc8',
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
default_configs = ", ".join(CONFIG_FILENAMES)
@ -195,5 +202,4 @@ def main():
if __name__ == "__main__":
import sys
sys.exit(main())