Skip to content

Commit 769d097

Browse files
committed
fix stylings
1 parent a553147 commit 769d097

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ print(recent_orders)
135135

136136
#Get option dates
137137
option_first = symbols.OptionQuote(ft_ss, "INTC")
138-
option_first.option_dates
139138
for item in option_first.option_dates["items"]:
140139
print(f"Expiration Date: {item["exp_date"]} Days Left: {item["day_left"]} Expiration Type: {item["exp_type"]}")
141140

firstrade/account.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, username, password, pin=None, email=None, phone=None, mfa_sec
6262
self.username = username
6363
self.password = password
6464
self.pin = pin
65-
self.email = self._mask_email(email) if email is not None else None
65+
self.email = FTSession._mask_email(email) if email is not None else None
6666
self.phone = phone
6767
self.mfa_secret = mfa_secret
6868
self.profile_path = profile_path
@@ -175,8 +175,9 @@ def _save_cookies(self):
175175
with open(path, "wb") as f:
176176
ftat = self.session.headers.get("ftat")
177177
pickle.dump(ftat, f)
178-
179-
def _mask_email(self, email):
178+
179+
@staticmethod
180+
def _mask_email(email):
180181
"""
181182
Masks the email for use in the API.
182183
@@ -238,9 +239,8 @@ def _handle_mfa(self):
238239
if self.pin or self.mfa_secret is not None:
239240
self.session.headers["sid"] = self.login_json["sid"]
240241
return False
241-
else:
242-
self.session.headers["sid"]= self.login_json["verificationSid"]
243-
return True
242+
self.session.headers["sid"]= self.login_json["verificationSid"]
243+
return True
244244

245245

246246
def __getattr__(self, name):

test.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,17 @@
8585
print(f"Order State: {order_conf["result"]["state"]}.")
8686

8787
# Cancel placed order
88-
#cancel = ft_accounts.cancel_order(order_conf['result']["order_id"])
89-
#if cancel["result"]["result"] == "success":
90-
#print("Order cancelled successfully.")
91-
#print(cancel)
88+
# cancel = ft_accounts.cancel_order(order_conf['result']["order_id"])
89+
# if cancel["result"]["result"] == "success":
90+
# print("Order cancelled successfully.")
91+
# print(cancel)
9292

9393
# Check orders
9494
recent_orders = ft_accounts.get_orders(ft_accounts.account_numbers[0])
9595
print(recent_orders)
9696

9797
#Get option dates
9898
option_first = symbols.OptionQuote(ft_ss, "INTC")
99-
option_first.option_dates
10099
for item in option_first.option_dates["items"]:
101100
print(f"Expiration Date: {item["exp_date"]} Days Left: {item["day_left"]} Expiration Type: {item["exp_type"]}")
102101

0 commit comments

Comments
 (0)