Exemplo n.º 1
0
def Button_6_onCommand(uiName, widgetName):
    ip = Fun.GetText(uiName, "Entry_3")
    port = Fun.GetText(uiName, "Entry_5")
    if (len(ip) <= 0 or len(port) <= 0):
        CSelectServerManger.startService()
    else:
        CSelectServerManger.startService(ip, port)
Exemplo n.º 2
0
def Button_11_onCommand(uiName, widgetName):
    ip = Fun.GetText(uiName, "Entry_3")
    port = Fun.GetText(uiName, "Entry_5")
    if (len(ip) <= 0 or len(port) <= 0):
        CClientSocketManger.startService()
    else:
        CClientSocketManger.startService(ip, port)
Exemplo n.º 3
0
def Button_6_onCommand(uiName,widgetName):
    global threadAction
    targetUrl = Fun.GetText(uiName,"Entry_3")
    total = Fun.GetText(uiName,"Entry_5")
    Text_2 = Fun.GetElement("RightTextBar","Text_2")
    Text_2.delete('0.0',tkinter.END)
    threadAction = True
    run_thread = threading.Thread(target=run, args=[targetUrl,uiName,0,int(total)])
    run_thread.start()
Exemplo n.º 4
0
def Button_9_onCommand(className, widgetName):
    start = Fun.GetText(className, "Entry_3")
    to = Fun.GetText(className, "Entry_5")
    date = Fun.GetText(className, "Entry_8")
    listBox = Fun.GetElement(className, "ListBox_10")
    ticket = Ticket()
    ticket.set_FromStation(start)
    ticket.set_ToStation(to)
    ticket.set_TicketDate(date)
    ticket.curlData(listBox)
Exemplo n.º 5
0
def Button_8_onCommand(uiName, widgetName):
    userId = Fun.GetText(uiName, 'Entry_5')
    passWd = Fun.GetText(uiName, 'Entry_6')
    txt = Fun.GetText('add', 'Button_8')
    if (txt == "修改"):
        item = GridBase.editSelected('DbList', 'TreeView_12', userId, passWd)
        DbBase.editAccountInfo(item[2], userId, passWd)
    else:
        id = DbBase.addAccountInfo(userId, passWd)
        GridBase.addItem('DbList', 'TreeView_12', userId, passWd, id)
    root = Fun.GetElement(uiName, 'root')
    root.destroy()
Exemplo n.º 6
0
def Button_4_onCommand(uiName,widgetName):
    StockCode = Fun.GetText(uiName,"Entry_3")
    StockInfo = StockMonitor.getStockInfo(StockCode)
    StockCode = StockInfo[u'code']
    StockName = StockInfo[u'name']
    StockTime = StockInfo[u'time']
    StockPrice = StockInfo[u'price']
    MaxPrice = Fun.GetText(uiName,"Entry_10")
    MinPrice =Fun.GetText(uiName,"Entry_12")
    TreeView13 = Fun.GetElement(uiName,"TreeView_13")
    TreeView13 .insert('','end',values=(StockCode[0],StockName[0],StockTime[0],StockPrice[0],MinPrice,MaxPrice))
    StockArray = Fun.GetUserData(uiName,"TreeView_13","StockArray")
    StockArray.append([StockCode[0],MaxPrice,MinPrice])
Exemplo n.º 7
0
def Button_13_onCommand(uiName, widgetName):
    msg = Fun.GetText(uiName, "Entry_10")
    service = CClientSocketManger.getService()
    if (service == None):
        Fun.MessageBox("连接已经关闭,不能发送消息!")
    else:
        service.sendMessage(msg)
Exemplo n.º 8
0
def Button_11_onCommand(uiName, widgetName):
    name = Fun.GetText(uiName, 'Entry_3')
    gender = Fun.GetTKVariable(uiName, 'Group_1')
    if gender == 1:
        gender = '男'
    else:
        gender = '女'
    age = Fun.GetText(uiName, 'Entry_8')
    combobox = Fun.GetElement(uiName, 'ComboBox_10')
    address = combobox.get()
    treeview = Fun.GetElement('TabPage1', 'TreeView_2')
    treeview.insert('', 'end', values=(name, gender, age, address))
    Fun.SetText(uiName, 'Entry_3', '')
    Fun.SetTKVariable(uiName, 'Group_1', 1)
    Fun.SetText(uiName, 'Entry_8', 0)
    combobox.current(0)
Exemplo n.º 9
0
def Button_4_onCommand(uiName, widgetName):
    UrlText = Fun.GetText(uiName, "Entry_3")
    Webbrowser_5 = Fun.GetElement(uiName, 'Webbrowser_5')
    Webbrowser_5.set_URL(UrlText)
    Button_7 = Fun.GetElement(uiName, 'Button_7')
    Button_7.configure(state="normal")
    Button_8 = Fun.GetElement(uiName, 'Button_8')
    Button_8.configure(state="disable")
Exemplo n.º 10
0
def Button_7_onCommand(uiName,widgetName):
    file1 = Fun.GetText(uiName, "Entry_4")
    file2 = Fun.GetText(uiName, "Entry_6")
    input1 = PdfFileReader(open(file1, "rb"))
    input2 = PdfFileReader(open(file2, "rb"))
    pageCount1 = input1.getNumPages()
    outPut1 = PdfFileWriter()
    dirName = os.path.dirname(file1)
    for iPage in range(input1.getNumPages()):
        outPut1.addPage(input1.getPage(iPage))
    for iPage in range(input2.getNumPages()):
        outPut1.addPage(input2.getPage(iPage))
    newFileName = os.path.join(dirName,"merge1.pdf")
    outputStream = open(newFileName, "wb")
    outPut1.write(outputStream)
    outputStream.close()
    Fun.MessageBox("merge finised,new file name is=merge1.pdf")
Exemplo n.º 11
0
def Button_6_onCommand(uiName,widgetName):
    global StockMonitorInst
    BtnText = Fun.GetText(uiName,widgetName)
    if BtnText == "启动监控":
        if StockMonitorInst == None:
            StockMonitorInst = StockMonitor.StockMonitor()
        StockArray = Fun.GetUserData(uiName,"TreeView_13","StockArray")
        for stockcode in StockArray:
            StockMonitorInst.addStock(stockcode[0],stockcode[1],stockcode[2])
        TreeView = Fun.GetElement(uiName,"TreeView_13")
        PhoneNumber=Fun.GetText(uiName,"Entry_17")
        StockMonitorInst.SetMonitorInfo(TreeView,PhoneNumber)       
        StockMonitorInst.StartMonitoring()    
        Fun.SetText(uiName,widgetName,"停止监控")
    else:
        StockMonitorInst.StopMonitoring()
        Fun.SetText(uiName,widgetName,"启动监控")
Exemplo n.º 12
0
def Button_6_onCommand(uiName, widgetName):
    QueryID = Fun.GetText(uiName, 'Entry_5')
    Express = Fun.GetElement(uiName, 'Express_9')
    ListBox = Fun.GetElement(uiName, 'ListBox_7')
    isThread = Fun.GetTKVariable(uiName, "CheckButton_10")
    print(isThread)
    if isThread == True:
        run_thread = threading.Thread(target=ThreadCount,
                                      args=[Express, QueryID, ListBox])
        run_thread.start()
    else:
        Express.set_ExpressNumber(QueryID)
        Express.Query(ListBox)
Exemplo n.º 13
0
def Button_12_onCommand(uiName, widgetName):
    openPath = tkinter.filedialog.askdirectory(initialdir=os.path.abspath('.'),
                                               title='打开目录查找')
    # 文件信息
    try:
        filePath = Fun.GetText(uiName, "Entry_4")
        input = PdfFileReader(open(filePath, "rb"))
    except Exception as e:
        Fun.MessageBox("文件异常,请检查!")
        return
    pageCount = input.getNumPages()
    dirName = os.path.dirname(filePath)
    # 分隔方式
    content = Fun.GetText(uiName, "Entry_8")
    if (len(content) <= 0):
        Fun.MessageBox("数据格式不对,请重新输入")
        return
    strList = content.split(",")
    #print(strList)
    # 检查参数是否正常
    try:
        for i in strList:
            if (len(i) <= 0):
                Fun.MessageBox("数据格式不对,请重新输入")
                return
            pageNum = int(i)
            if (pageNum >= pageCount):
                Fun.MessageBox("要分割的页数不能超过总页数啊!")
                return
    except Exception as e:
        print(e)
        Fun.MessageBox("数据格式不对,请重新输入")
        return
    outPutDic = {}
    for iPage in range(pageCount):
        rang = getRange(strList, iPage)
        if (rang == "0"):
            rang = str(pageCount)
        if (outPutDic.get(rang, -1) == -1):
            outPutDic[rang] = {
                "fileName": rang + ".pdf",
                "outPut": PdfFileWriter()
            }
            outPutDic[rang]['outPut'].addPage(input.getPage(iPage))
        else:
            if (outPutDic[rang] == None):
                outPutDic[rang] = {
                    "fileName": rang + ".pdf",
                    "outPut": PdfFileWriter()
                }
                outPutDic[rang]['outPut'].addPage(input.getPage(iPage))
            else:
                outPutDic[rang]['outPut'].addPage(input.getPage(iPage))
    for item in outPutDic.values():
        newFileName = os.path.join(dirName, item['fileName'])
        outputStream = open(newFileName, "wb")
        item['outPut'].write(outputStream)
        outputStream.close()
        msg = item['fileName'] + "  has been created!"
        showMsg(uiName, msg)
    showMsg(uiName, "split pdf file over!")
    '''
Exemplo n.º 14
0
def Button_12_onCommand(uiName,widgetName):
     file_dir = Fun.GetText(uiName, "Entry_11")
     outfile = "out.pdf"
     MergePDF(file_dir, outfile)