Skip to content

Commit

Permalink
Eliminate code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
James McKinney committed Jan 30, 2016
1 parent 7299d02 commit c589c3b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions csvkit/convert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,9 @@ def guess_format(filename):

extension = filename[last_period + 1:].lower()

if extension == 'xls':
return extension
elif extension == 'xlsx':
if extension in ('csv', 'dbf', 'fixed', 'xls', 'xlsx'):
return extension
elif extension in ['json', 'js']:
return 'json'
elif extension == 'csv':
return extension
elif extension == 'fixed':
return extension
elif extension == 'dbf':
return extension

return None

0 comments on commit c589c3b

Please sign in to comment.