Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

基于0.8.8的4个问题 #15

Open
FreeBoy-V-V opened this issue Nov 13, 2019 · 0 comments
Open

基于0.8.8的4个问题 #15

FreeBoy-V-V opened this issue Nov 13, 2019 · 0 comments

Comments

@FreeBoy-V-V
Copy link

FreeBoy-V-V commented Nov 13, 2019

问题1、华泰只能在新股页面打新。如下修改方法:
(1)159行MEMBERS字典中可以增加打新的界面参数。
测试修改方法如下:

'raffle': (1032, 1541, 1033, 1847, 1034, 0)

(2)298行增加打新按钮的判断。
测试修改方法如下:

return self.fill(qty or full).click_button(label={
    'buy': '买入[B]',
    'sell': '卖出[S]',
    'raffle': '申购[B]'
}[action])

(3)346行修改在新股申购界面打新,并增加科创板的判断。
测试修改方法如下:

def raffle(self):
    "新股申购"
    self.query.cache_clear()
    def func(ipo, orders):
        symbol = ipo.get('新股代码') or ipo.get('证券代码')
        price = ipo.get('申购价格') or ipo.get('发行价格')
        had = [order['证券代码'] for order in orders]
        if symbol in had:
            r = (0, 'SUCC: %s 已经申购!!!' % symbol)
        elif symbol.startswith('787'):
            r = (0, '请开通科创板')
        elif symbol not in had:
            r = self.trade('raffle', symbol, price, 0).wait().answer()
        else:
            r = (0, '不可预测的申购错误')
        return r
    target = self.new
    if target:
        orders = self.entrustment
        return [func(ipo, orders) for ipo in target]

(4)508行增加打新的判断。
测试修改方法如下:

if action in ('buy', 'buy2', 'sell', 'sell2', 'raffle'):

问题2、登陆页面未登陆成功或者程序异常,导致无法正常关闭交易客户端。如下修改方法:
(1)255行退出方法增加登陆框的判断和主窗体的判断。
测试修改方法如下:

def exit(self):
    "退出系统并关闭程序"
    try:
        if self.hLogin and self.hLogin != 0:
            user32.PostMessageW(self.hLogin, MSG['WM_CLOSE'], 0, 0)
            print("退出登陆界面")
    except Exception as e:
        print(repr(e))
    try:
        if self.root and self.root != 0:
            user32.PostMessageW(self.root, MSG['WM_CLOSE'], 0, 0)
        print("退出客户端")
    except Exception as e:
        print(repr(e))   
    return self

问题3、交易之后总是返回“木偶无响应”的提示。如下修改方法:
(1)616行增加返回字符串的判断,并再次获取弹出框提示。
测试修改方法如下:

def answer(self):
    text = self.capture()
    if any(('木偶' in text, '小数部分' in text, '您确认' in text, )):
        print(text)
        text = self.capture()
    if '合同编号' in text:
        return (re.findall(r'(\w*[0-9]+)\w*', text)[0], 'action succ!!!')
    else:
        return (0, text)

问题4:华泰在打新页面、打新结果这两个页面,表格没有焦点,所以ctrl+s没有反应。最终结果是提示table.xls文件找不到的错误。

这个暂时不会修改。

问题5:在云服务器上部署,无法通过快捷键复制表格的数据,总是提示table.xls文件找不到的错误。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant