Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few changes and fixes. #43

Merged
merged 3 commits into from Apr 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions socli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .socli import main
main()
from .socli import main

if __name__ == '__main__':
main()
10 changes: 1 addition & 9 deletions socli/socli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,7 +62,6 @@ def fixCodePage():
else:
return


# Bold and underline are not supported by colorama.
class bcolors:
BOLD = '\033[1m'
Expand Down Expand Up @@ -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()
main()