From 21c65bc12bab868ad77a712e943e51ad19f9f8fe Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 18 Aug 2018 17:23:22 +0200 Subject: [PATCH 1/5] setup.py: whitespace changes to placate flake8 --- setup.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/setup.py b/setup.py index df03fc01..7805ec6a 100644 --- a/setup.py +++ b/setup.py @@ -3,17 +3,17 @@ ''' vn.py - By Traders, For Traders. -The vn.py project is an open-source quantitative trading framework -that is developed by traders, for traders. +The vn.py project is an open-source quantitative trading framework +that is developed by traders, for traders. -The project is mainly written in Python and uses C++ for low-layer +The project is mainly written in Python and uses C++ for low-layer and performance sensitive infrastructure. -Using the vn.py project, institutional investors and professional -traders, such as hedge funds, prop trading firms and investment banks, -can easily develop complex trading strategies with the Event Engine -Strategy Module, and automatically route their orders to the most -desired destinations, including equity, commodity, forex and many +Using the vn.py project, institutional investors and professional +traders, such as hedge funds, prop trading firms and investment banks, +can easily develop complex trading strategies with the Event Engine +Strategy Module, and automatically route their orders to the most +desired destinations, including equity, commodity, forex and many other financial markets. ''' @@ -31,7 +31,7 @@ def getSubpackages(name): for dirpath, _dirnames, _filenames in os.walk(name): if os.path.isfile(os.path.join(dirpath, '__init__.py')): splist.append(".".join(dirpath.split(os.sep))) - + return splist @@ -43,7 +43,7 @@ setup( license='MIT', url='http://www.vnpy.org', description='A framework for developing Quantitative Trading programmes', - long_description = __doc__, + long_description=__doc__, keywords='quant quantitative investment trading algotrading', classifiers=['Development Status :: 4 - Beta', 'Operating System :: Microsoft :: Windows :: Windows 7', @@ -60,7 +60,4 @@ setup( '*.h', '*.cpp', '*.bash', '*.txt', '*.dll', '*.lib', '*.so', '*.pyd', '*.dat', '*.ini', '*.pfx', '*.scc', '*.crt', '*.key']}, - extras_require={ - 'tq': ["tornado>=4.5.1", "sortedcontainers>=1.5.7"], - } -) + extras_require={'tq': ["tornado>=4.5.1", "sortedcontainers>=1.5.7"]}) From 9c3559aa981de546c6974f89c0abe2bfe65e648e Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 21 Aug 2018 17:11:38 +0200 Subject: [PATCH 2/5] Travis CI: Remove branches: only: master, dev --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1b6f9c53..42b24f67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,6 @@ cache: pip python: - 2.7 - 3.6 -branches: - only: - - master - - dev install: - pip install -r requirements.txt - pip install flake8 # pytest # add another testing frameworks later @@ -15,7 +11,7 @@ before_script: # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - flake8 . --count --exit-zero --ignore=E265 --max-complexity=10 --max-line-length=127 --statistics script: - true # pytest --capture=sys # add other tests here notifications: From 47e823e81726e1981fdcca2665dcce0d86ad345c Mon Sep 17 00:00:00 2001 From: cclauss Date: Wed, 22 Aug 2018 10:30:38 +0200 Subject: [PATCH 3/5] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 42b24f67..fd330019 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ before_script: # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - - flake8 . --count --exit-zero --ignore=E265 --max-complexity=10 --max-line-length=127 --statistics + - flake8 . --count --exit-zero --ignore=E265,W2 --max-complexity=10 --max-line-length=127 --statistics script: - true # pytest --capture=sys # add other tests here notifications: From 8e4f9121a100275a1d7a2d30d9eae59f712b434c Mon Sep 17 00:00:00 2001 From: studynon Date: Sat, 25 Aug 2018 10:33:54 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[Mod]ctpGateway=E7=9A=84Python3=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=80=A7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/ctpGateway/ctpGateway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index 0aa11e72..bfd68504 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -108,7 +108,7 @@ class CtpGateway(VtGateway): def connect(self): """连接""" try: - f = file(self.filePath) + f = open(self.filePath) except IOError: log = VtLogData() log.gatewayName = self.gatewayName From f60547865419727829fe00a9ff3255b87a7806c8 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 26 Aug 2018 22:46:19 +0800 Subject: [PATCH 5/5] Update ctpGateway.py add f.close() --- vnpy/trader/gateway/ctpGateway/ctpGateway.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index bfd68504..419d4edd 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -118,6 +118,7 @@ class CtpGateway(VtGateway): # 解析json文件 setting = json.load(f) + f.close() try: userID = str(setting['userID']) password = str(setting['password']) @@ -1503,4 +1504,4 @@ class CtpTdApi(TdApi): - \ No newline at end of file +