Skip to content

Commit

Permalink
Fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gleitz committed Jul 15, 2015
1 parent 14116ff commit b10cf82
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions howdoi/howdoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
# http://stackoverflow.com/a/6633040/305414
if sys.version < '3':
import codecs

def u(x):
return codecs.unicode_escape_decode(x)[0]
else:
Expand All @@ -66,7 +67,7 @@ def u(x):
os.path.join(os.path.expanduser('~'), '.cache'))
CACHE_DIR = os.path.join(XDG_CACHE_DIR, 'howdoi')
CACHE_FILE = os.path.join(CACHE_DIR, 'cache{0}'.format(
sys.version_info[0] if sys.version_info[0] == 3 else ''))
sys.version_info[0] if sys.version_info[0] == 3 else ''))


def get_proxies():
Expand Down Expand Up @@ -217,25 +218,25 @@ def get_parser():
parser = argparse.ArgumentParser(description='instant coding answers via the command line')
parser.add_argument('query', metavar='QUERY', type=str, nargs='*',
help='the question to answer')
parser.add_argument('-p','--pos', help='select answer in specified position (default: 1)', default=1, type=int)
parser.add_argument('-a','--all', help='display the full text of the answer',
parser.add_argument('-p', '--pos', help='select answer in specified position (default: 1)', default=1, type=int)
parser.add_argument('-a', '--all', help='display the full text of the answer',
action='store_true')
parser.add_argument('-l','--link', help='display only the answer link',
parser.add_argument('-l', '--link', help='display only the answer link',
action='store_true')
parser.add_argument('-c', '--color', help='enable colorized output',
action='store_true')
parser.add_argument('-n','--num-answers', help='number of answers to return', default=1, type=int)
parser.add_argument('-C','--clear-cache', help='clear the cache',
parser.add_argument('-n', '--num-answers', help='number of answers to return', default=1, type=int)
parser.add_argument('-C', '--clear-cache', help='clear the cache',
action='store_true')
parser.add_argument('-v','--version', help='displays the current version of howdoi',
parser.add_argument('-v', '--version', help='displays the current version of howdoi',
action='store_true')
return parser


def command_line_runner():
parser = get_parser()
args = vars(parser.parse_args())

if args['version']:
print(__version__)
return
Expand All @@ -262,6 +263,5 @@ def command_line_runner():
print(howdoi(args))



if __name__ == '__main__':
command_line_runner()

0 comments on commit b10cf82

Please sign in to comment.