# Path: fooltrader/api/technical.py
# def get_trading_calendar(security_type='future', exchange='shfe'):
#     the_path = get_exchange_trading_calendar_path(security_type, exchange)
# 
#     trading_dates = []
#     if os.path.exists(the_path):
#         with open(the_path) as data_file:
#             trading_dates = json.load(data_file)
#     return trading_dates
# 
# Path: fooltrader/contract/files_contract.py
# def get_exchange_trading_calendar_path(security_type='future', exchange='shfe'):
#     return os.path.join(get_exchange_dir(security_type, exchange), 'trading_calendar.json')
# 
# Path: fooltrader/utils/utils.py
# def next_date(the_time):
#     return to_timestamp(the_time) + datetime.timedelta(days=1)
# 
# def to_time_str(the_time, time_fmt=TIME_FORMAT_DAY):
#     try:
#         if time_fmt == TIME_FORMAT_MICRO:
#             return to_timestamp(the_time).strftime(time_fmt)[0:-3]
#         else:
#             return to_timestamp(the_time).strftime(time_fmt)
#     except Exception as e:
#         return the_time
# 
# def drop_duplicate(the_list):
#     return list(set(the_list))


import json
import pandas as pd
import scrapy
from datetime import datetime
from scrapy import Request
from scrapy import signals
from fooltrader.api.technical import get_trading_calendar
from fooltrader.contract.files_contract import get_exchange_trading_calendar_path
from fooltrader.utils.utils import next_date, to_time_str, drop_duplicate
# -*- coding: utf-8 -*-





class ShfeTradingCalendarSpider(scrapy.Spider):
    name = "shfe_trading_calendar_spider"

    custom_settings = {
        # 'DOWNLOAD_DELAY': 2,
        # 'CONCURRENT_REQUESTS_PER_DOMAIN': 8,

        # 'SPIDER_MIDDLEWARES': {
        #     'fooltrader.middlewares.FoolErrorMiddleware': 1000,
        # }
    }


# Path: fooltrader/api/technical.py
# def get_trading_calendar(security_type='future', exchange='shfe'):
#     the_path = get_exchange_trading_calendar_path(security_type, exchange)
# 
#     trading_dates = []
#     if os.path.exists(the_path):
#         with open(the_path) as data_file:
#             trading_dates = json.load(data_file)
#     return trading_dates
# 
# Path: fooltrader/contract/files_contract.py
# def get_exchange_trading_calendar_path(security_type='future', exchange='shfe'):
#     return os.path.join(get_exchange_dir(security_type, exchange), 'trading_calendar.json')
# 
# Path: fooltrader/utils/utils.py
# def next_date(the_time):
#     return to_timestamp(the_time) + datetime.timedelta(days=1)
# 
# def to_time_str(the_time, time_fmt=TIME_FORMAT_DAY):
#     try:
#         if time_fmt == TIME_FORMAT_MICRO:
#             return to_timestamp(the_time).strftime(time_fmt)[0:-3]
#         else:
#             return to_timestamp(the_time).strftime(time_fmt)
#     except Exception as e:
#         return the_time
# 
# def drop_duplicate(the_list):
#     return list(set(the_list))


# Path: fooltrader/spiders/chinafuture/shfe_trading_calendar_spider.py
import json
import pandas as pd
import scrapy
from datetime import datetime
from scrapy import Request
from scrapy import signals
from fooltrader.api.technical import get_trading_calendar
from fooltrader.contract.files_contract import get_exchange_trading_calendar_path
from fooltrader.utils.utils import next_date, to_time_str, drop_duplicate

# -*- coding: utf-8 -*-





class ShfeTradingCalendarSpider(scrapy.Spider):
    name = "shfe_trading_calendar_spider"

    custom_settings = {
        # 'DOWNLOAD_DELAY': 2,
        # 'CONCURRENT_REQUESTS_PER_DOMAIN': 8,

        # 'SPIDER_MIDDLEWARES': {
        #     'fooltrader.middlewares.FoolErrorMiddleware': 1000,
        # }
    }


    def __init__(self, name=None, **kwargs):