예제 #1
0
def upload_zip_files(dir_name):
    year, month = get_current_year_month()
    file_path = path + str(year) + '-' + str(month) + '/' + dir_name + '.zip'
    url = mod_config.get_config('post_url', 'url') + '?file_path=' + file_path + '&file_name=' + dir_name
    logger.info(url)
    req = urllib2.Request(url)
    res_data = urllib2.urlopen(req)
    res = res_data.read()
    logger.info(res)
예제 #2
0
def upload_daily_files():
    today = datetime.date.today().strftime('%Y%m%d')
    file_path = sys.path[0].split('service')[0] + '/service/news/files/'+today+'.zip'
    url = mod_config.get_config('post_url', 'url') + '?file_path=' + file_path + '&file_name=' + today
    logger.info(url)
    req = urllib2.Request(url)
    res_data = urllib2.urlopen(req)
    res = res_data.read()
    logger.info(res)
예제 #3
0
parent_path = sys.path[0].split('service')[0] + '/service/loggings'
parent_path1 = sys.path[0].split('service')[0] + '/service/utils'
parent_path2 = sys.path[0].split('service')[0] + '/service/common'
if parent_path not in sys.path:
    sys.path.append(parent_path)
if parent_path1 not in sys.path:
    sys.path.append(parent_path1)
if parent_path2 not in sys.path:
    sys.path.append(parent_path2)

import mod_config
import log_processor
import tushare_data_util

logger = log_processor.get_logger(__name__)
path = mod_config.get_config("path", "path")


@download_decorator.download_stocks_json_file
def get_hist_data(stock_code, **params):
    try:
        logger.info('get get history stocks data starting...')
        df = ts.get_hist_data(stock_code, **params)
        logger.info('get get history stocks data end...')
    except:
        logger.exception('some errors between get history stocks data: ')
    return df


@download_decorator.download_json_file
def get_stock_basics(**params):
예제 #4
0
def set_wmcloud_token(ts):
    ts.set_token(mod_config.get_config('wmcloud','token'))