Skip to content

Commit

Permalink
发布 2.0 系统,增加系统版本说明。
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy committed Sep 20, 2021
1 parent 9944768 commit c8ed429
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 8 deletions.
3 changes: 3 additions & 0 deletions libs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
MYSQL_CONN_URL = "mysql+mysqldb://" + MYSQL_USER + ":" + MYSQL_PWD + "@" + MYSQL_HOST + ":3306/" + MYSQL_DB + "?charset=utf8mb4"
print("MYSQL_CONN_URL :", MYSQL_CONN_URL)

__version__ = "2.0.0"
# 每次发布时候更新。

def engine():
engine = create_engine(
MYSQL_CONN_URL,
Expand Down
1 change: 1 addition & 0 deletions web/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import tornado.web
import libs.stock_web_dic as stock_web_dic
import libs.common as common

#基础handler,主要负责检查mysql的数据库链接。
class BaseHandler(tornado.web.RequestHandler):
Expand Down
5 changes: 4 additions & 1 deletion web/chartHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from tornado import gen
import libs.stock_web_dic as stock_web_dic
import web.base as webBase
import libs.common as common
import logging
import tornado.web
import matplotlib
Expand Down Expand Up @@ -43,5 +44,7 @@ def get(self):
# self.uri_ = ("self.request.url:", self.request.uri)
# print self.uri_
logging.info("chart...")
self.render("stock_chart.html", entries="", leftMenu=webBase.GetLeftMenu(self.request.uri))
self.render("stock_chart.html", entries="",
pythonStockVersion=common.__version__,
leftMenu=webBase.GetLeftMenu(self.request.uri))

5 changes: 4 additions & 1 deletion web/dataEditorHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# sys.path.append(os.path.abspath('/data/stock/libs'))
import libs.stock_web_dic as stock_web_dic
import web.base as webBase
import libs.common as common
import logging
import re

Expand All @@ -19,7 +20,9 @@ def get(self):
stockWeb = stock_web_dic.STOCK_WEB_DATA_MAP[name]
# self.uri_ = ("self.request.url:", self.request.uri)
# print self.uri_
self.render("data_editor.html", stockWeb=stockWeb, leftMenu=webBase.GetLeftMenu(self.request.uri))
self.render("data_editor.html", stockWeb=stockWeb,
pythonStockVersion=common.__version__,
leftMenu=webBase.GetLeftMenu(self.request.uri))


# 拼接sql,将value的key 和 value 放到一起。
Expand Down
4 changes: 3 additions & 1 deletion web/dataIndicatorsHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def get(self):
logging.info("error :", e)
logging.info("#################### GetStockHtmlHandlerEnd ####################")

self.render("stock_indicators.html", comp_list=comp_list, leftMenu=webBase.GetLeftMenu(self.request.uri))
self.render("stock_indicators.html", comp_list=comp_list,
pythonStockVersion=common.__version__,
leftMenu=webBase.GetLeftMenu(self.request.uri))


# 配置数据
Expand Down
2 changes: 2 additions & 0 deletions web/dataTableHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import json
from tornado import gen
import libs.common as common
import libs.stock_web_dic as stock_web_dic
import web.base as webBase
import logging
Expand Down Expand Up @@ -58,6 +59,7 @@ def get(self):
print("error :", e)
logging.info("####################GetStockHtmlHandlerEnd")
self.render("stock_web.html", stockWeb=stockWeb, date_now=date_now_str,
pythonStockVersion=common.__version__,
leftMenu=webBase.GetLeftMenu(self.request.uri))


Expand Down
9 changes: 7 additions & 2 deletions web/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,20 @@ def get(self):
self.render("index.html", pandasVersion=pandasVersion, numpyVersion=numpyVersion,
akshareVersion=akshareVersion, bokehVersion=bokehVersion,
stockstatsVersion="0.3.2", talibVersion=talibVersion, jupyterVersion=jupyterVersion,
pythonStockVersion = common.__version__,
leftMenu=webBase.GetLeftMenu(self.request.uri))
class TestHandler(webBase.BaseHandler):
@gen.coroutine
def get(self):
self.render("test_akshare.html", entries="hello", leftMenu=webBase.GetLeftMenu(self.request.uri))
self.render("test_akshare.html", entries="hello",
pythonStockVersion=common.__version__,
leftMenu=webBase.GetLeftMenu(self.request.uri))
class Test2Handler(webBase.BaseHandler):
@gen.coroutine
def get(self):
self.render("test2.html", entries="hello", leftMenu=webBase.GetLeftMenu(self.request.uri))
self.render("test2.html", entries="hello",
pythonStockVersion=common.__version__,
leftMenu=webBase.GetLeftMenu(self.request.uri))

def main():
tornado.options.parse_command_line()
Expand Down
2 changes: 1 addition & 1 deletion web/templates/common/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="navbar-container ace-save-state" id="navbar-container">
<div class="navbar-header pull-left">
<a href="/" class="navbar-brand">
<small><i class="fa fa-leaf"></i>股票系统</small>
<small><i class="fa fa-leaf"></i>开源Python全栈股票系统,数据抓取、统计分析、报表展示 版本:{{ pythonStockVersion }}</small>
</a>
</div>

Expand Down
2 changes: 1 addition & 1 deletion web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% block main_content %}

<h3 class="header smaller lighter blue">欢迎使用股票系统</h3>
<h3 class="header smaller lighter blue">开源Python全栈股票系统,数据抓取、统计分析、报表展示</h3>


<div class="clearfix">
Expand Down
2 changes: 1 addition & 1 deletion web/templates/layout/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>股票系统</title>
<title>股票系统 {{ pythonStockVersion }}</title>
{% block meta %}{% end %}
</head>

Expand Down

0 comments on commit c8ed429

Please sign in to comment.