init
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import shutil
|
||||
import time
|
||||
import sqlite3
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from stock.crawler.FnGuideCrawler import FnGuideCrawler
|
||||
from stock.crawler.MetaCrawler import MetaCrawler
|
||||
from stock.crawler.StockCrawler import StockCrawler
|
||||
from stock.analysis.AnalyzerSqlite import AnalyzerSqlite
|
||||
|
||||
|
||||
class StockCrawlerDaily:
|
||||
@@ -113,27 +108,6 @@ class StockCrawlerDaily:
|
||||
print("\n[US 종목 수집]")
|
||||
stockCrawler.crawl_special_stocks(stockFileName)
|
||||
|
||||
analyzerSqlite = AnalyzerSqlite(RESOURCE_PATH)
|
||||
|
||||
print("\n[종목 결정]")
|
||||
# HTML 출력
|
||||
outPath = os.path.join(self.PROJECT_HOME, "resources", "analysis")
|
||||
if not os.path.isdir(outPath):
|
||||
os.mkdir(outPath)
|
||||
day = datetime.today().strftime("%Y%m%d")
|
||||
before_7_day = datetime.today() + relativedelta(days=-7)
|
||||
dayList = os.listdir(outPath)
|
||||
for dayDir in dayList:
|
||||
if dayDir[0] != '.' and dayDir < before_7_day.strftime("%Y%m%d"):
|
||||
if os.path.exists(os.path.join(outPath, dayDir)) and os.path.isdir(os.path.join(outPath, dayDir)):
|
||||
shutil.rmtree(os.path.join(outPath, dayDir))
|
||||
outPath = os.path.join(outPath, day)
|
||||
if os.path.isdir(outPath):
|
||||
shutil.rmtree(outPath)
|
||||
os.mkdir(outPath)
|
||||
|
||||
analyzerSqlite.findCandidates(outPath)
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user