Skip to content

Commit

Permalink
Made History.change_frequency compatible with python2.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
afcmrp committed Mar 29, 2018
1 parent 495dd7f commit 287775d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions invain/History.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,15 @@ def change_frequency(self, frequency, num_between=1):
else:
print("Error Changing Frequency: num_between is not of type int")
return False

self.interval = n +"d" if compare == 'daily' else n + "wk" if compare == 'weekly' else n + "mo" if compare == 'monthly' else print("Error Changing Frequency: Not a Valid Frequency"); return False
if compare == 'daily':
self.interval = n + "d"
elif compare == 'weekly':
self.interval = n + "wk"
elif compare == 'monthly':
self.interval = n + "mo"
else:
print("Error Changing Frequency: Not a Valid Frequency")
return False
return True

def get_date(self, ticker=None):
Expand Down

0 comments on commit 287775d

Please sign in to comment.