diff --git a/.gitignore b/.gitignore index 3be4a9d..3019ea6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,14 @@ -.idea/ -build/ -dist/ -socli.egg-info/ -socli/__pycache__/ -socli/data.json -docs/ -*.pyc +# Python .gitignore + +.DS_Store +.idea/ +__pycache__/ +dist/ +build/ +*.egg-info +.cache/ +.tox +.coverage +*.pyc +*.egg +venv diff --git a/socli/__main__.py b/socli/__main__.py index dc15d0c..617aedf 100644 --- a/socli/__main__.py +++ b/socli/__main__.py @@ -1,2 +1,4 @@ -from .socli import main -main() \ No newline at end of file +from .socli import main + +if __name__ == '__main__': + main() diff --git a/socli/socli.py b/socli/socli.py index 252d0bf..889f27a 100644 --- a/socli/socli.py +++ b/socli/socli.py @@ -15,7 +15,6 @@ from bs4 import BeautifulSoup import random - # Global vars: DEBUG = False # Set True for enabling debugging soqurl = "http://stackoverflow.com/search?q=" # Query url @@ -63,7 +62,6 @@ def fixCodePage(): else: return - # Bold and underline are not supported by colorama. class bcolors: BOLD = '\033[1m' @@ -957,22 +955,16 @@ def main(): elif (rn > 0): wrongsyn(query) socl_manusearch(query, rn) - sys.exit(0) elif (rn == 0): print_warning("Count starts from 1. Use: \"socli -i 2 -q python for loop\" for the 2nd result for the query") - sys.exit(0) elif (ir == 1): wrongsyn(query) socli_interactive(query) - sys.exit(0) elif query != "": socli(query) - sys.exit(0) else: print_warning("Wrong syntax...!\n") helpman() - sys.exit(0) - if __name__ == '__main__': - main() \ No newline at end of file + main()