Пример #1
0
def forwardReq(a):
    # url_path = urlparse(a.path).path
    # if not url_path == '/0':return a.send_not_found()
    # method U.msgbox(a.command)
    req = urlparse.urlparse(a.path).query
    reqs = urlparse.parse_qs(req, keep_blank_values=True)

    if len(reqs) == 0:
        a.send_response('text/html',
                        U.read(U.getModPath() + 'file/webControl.html'))
        # U.msgbox([i for i in sys.modules if 'webC' in i])
        U.r(sys.modules['qgb.N.webControl'])
        return

    from qgb import Win as w

    if len(reqs) == 1:
        # t=T.subLast(a.path,'t=','') or 0
        # t=int(t)
        t = int(reqs['t'][0])
        if t & WUP:
            for i in range(5):
                w.mouse_event(0, 0, t, move=False, abs=True)
        if t & WDOWN:
            for i in range(3):
                w.mouse_event(0, 0, t, move=False, abs=True)

        w.mouse_event(0, 0, t, move=False, abs=True)
        # a.send_response('text/html',w.getLastErr())
        # a.wfile.write('\r\n'*5)
        return
    if len(reqs) == 2:
        x = int(reqs['x'][0])
        y = int(reqs['y'][0])
        w.setCurPos(x, y)
        return
Пример #2
0
giClickY = 34
from qgb import py, Win, U, T, N, F
# U=py.importU()
from pywinauto import Application
app = Application()
pids = [i[0] for i in Win.getAllWindows() if i[1].endswith(gsTitle)]
ws = []
for i in pids:
    i = app.Connect(handle=i)
    i = i.windows()
    for w in i:
        if w.WindowText().endswith(gsTitle):
            if w not in ws: ws.append(w)
# F.dill_dump(obj=ws,file='browserGo_ws')
U.pprint(U.il(ws))
if U.ct(ws) == 0: Win.setCurPos(giClickY, giClickY)


def istop():
    x, y = Win.getCurPos()
    if y > giClickY * 6 or y > ih - 9:
        U.pln(iw, ih, i, 'Cur:', x, y)
        U.exit()


def click(w, x, y=giClickY):
    istop()
    try:
        w.Maximize()
        r = w.Rectangle()
        if x > (r.right - r.left) - 200 - 65: