Skip to content

Commit

Permalink
Fix bug when loading CorpList multiple times(#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
josw123 committed Jul 28, 2020
1 parent 994c1d1 commit 30cef8e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions dart_fss/corp/corp_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,20 @@ def __init__(self, profile=False):
self._stock_market = dict()
self._profile = profile

if self._corps is None:
self.load(profile=self._profile)
self.load(profile=self._profile)

def load(self, profile=False):
""" 회사 정보가 없을시 회사 정보 로딩
Parameters
----------
profile: bool, optional
상세정보 로딩 여부
"""
if self._corps is None:
self._load(profile=profile)

def _load(self, profile=False):
""" 회사 정보 로딩
Parameters
Expand Down Expand Up @@ -119,8 +129,7 @@ def load(self, profile=False):
@property
def corps(self):
""" 모든 상장된 종목(회사)를 반환한다 """
if self._corps is None:
self.load(profile=self._profile)
self.load(profile=self._profile)
return self._corps

def find_by_corp_code(self, corp_code):
Expand Down

0 comments on commit 30cef8e

Please sign in to comment.