Skip to content

Commit

Permalink
fix #40: better handling of filename extension
Browse files Browse the repository at this point in the history
  • Loading branch information
josuebrunel committed Oct 14, 2015
1 parent 97b86b6 commit a97fcb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yahoo_oauth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def get_file_extension(filename):
def get_data(filename):
"""Calls right function according to file extension
"""
ext = get_file_extension(filename)
name, ext = get_file_extension(filename)
func = json_get_data if ext == '.json' else yaml_get_data
return func(filename)

def write_data(data, filename):
"""Call right func to save data according to file extension
"""
ext = get_file_extension(filename)
name, ext = get_file_extension(filename)
func = json_write_data if ext == '.json' else yaml_write_data
return func(data, filename)

Expand Down

0 comments on commit a97fcb9

Please sign in to comment.