Skip to content

Commit

Permalink
#update
Browse files Browse the repository at this point in the history
  • Loading branch information
yutiansut committed Jun 20, 2018
1 parent 5c08bb0 commit a281a14
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
29 changes: 29 additions & 0 deletions QUANTAXIS/QAEngine/QACurioEngine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from curio import UniversalQueue, run, sleep, spawn
from threading import Thread


def consumer(queue):
while True:
item = queue.get()
if item is None:
break
print('Got:', item)


async def producer(n, m, queue):
for x in range(n):
await queue.put(x)
await sleep(m)
await queue.put(None)


async def main():
q = UniversalQueue()
Thread(target=consumer, args=(q,)).start()
t = await spawn(producer, 100, 1, q)
t1 = await spawn(producer, 100, 0.2, q)
t2 = await spawn(producer, 100, 0.5, q)
await t.join()
await t1.join()
await t2.join()
run(main)
9 changes: 6 additions & 3 deletions QUANTAXIS/QAWeb/fetch_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
import QUANTAXIS as QA
import pandas as pd
import re
block_tdx = QA.DATABASE.stock_block
block_ths = QA.DATABASE.stock_block_ths
codelist = QA.QA_fetch_stock_list_adv()

try:
block_tdx = QA.DATABASE.stock_block
block_ths = QA.DATABASE.stock_block_ths
codelist = QA.QA_fetch_stock_list_adv()
except:
pass

def get_block(block):
block = [block] if isinstance(block, str) else block
Expand Down
5 changes: 3 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import sphinx_rtd_theme
import os
import sys
import QUANTAXIS as QA
# sys.path.insert(0, os.path.abspath('.'))


Expand All @@ -25,9 +26,9 @@
author = 'yutiansut'

# The short X.Y version
version = '1.0.39'
version = QA.__version__
# The full version, including alpha/beta/rc tags
release = '1.0.39'
release = QA.__version__


# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit a281a14

Please sign in to comment.