def chat_file_func(): filename = QtGui.QFileDialog.getOpenFileName(self, 'Open File', '.') fname = open(filename) data = fname.read() self.textEdit.setText(data) fname.close() try: so = SocketHandler('localhost', port) except RuntimeError as err: print err if not so.auth(None, None, True): print "error in auth" exit() so.write_message(receiver, text) #if so.write_group_message("meop", str(datetime.time(datetime.now()))): # print "geht" #else: # print "fail" #messages = so.get_messages("1") #print messages #counter = 0 # while counter < 5: # if isinstance(messages, bool): # print "error in getting messages" # counter += 1 # time.sleep(3) # messages = so.get_messages("1") # time.sleep(3) # so.write_group_message("meop", str(datetime.time(datetime.now()))) # else: # for item in messages: # print unicode(item[0]) + ":" + unicode(item[1]) # exit() # while counter < 5: # print so.write_group_message("moep", str(datetime.time(datetime.now()))) # time.sleep(3) # print so.get_messages("1") # time.sleep(3) # counter += 1 """
def login_func(): user = str(window.lineEdit_3.text()) password = str(window.lineEdit.text()) stayLogedIn = window.checkBox.isChecked() #port = int(sys.argv[1]) port = 32325 try: so = SocketHandler('localhost', port) except RuntimeError as err: print err if not so.auth(None, None, True): print "error in auth" exit() else: window_def = "normal"
def login_func(): user = str(window_login.lineEdit_3.text()) password = str(window_login.lineEdit.text()) stayLogedIn = window_login.checkBox.isChecked() #port = int(sys.argv[1]) port = 32325 try: so = SocketHandler('localhost', port) except RuntimeError as err: print err if not so.auth(user, password, stayLogedIn): print "error in auth" else: print("Login Success") window_login.hide() home_screen()
window = MainWindow() window.show() window.connect(window.pushButton_2, QtCore.SIGNAL("clicked()"), app.quit) window.connect(window.pushButton, QtCore.SIGNAL("clicked()"), login) if app: app.exec_() ## Other Stuff port = 32325 try: so = SocketHandler("localhost", port) except RuntimeError as err: print err if not so.auth(None, None, True): print "error in auth" exit() if so.write_group_message("meop", str(datetime.time(datetime.now()))): print "geht" else: print "fail" messages = so.get_messages("1") print messages counter = 0
from datetime import datetime import time from libinfoclient import SocketHandler import sys import time from os.path import exists from PyQt4 import QtCore, QtGui, uic import PyQt4.uic window_def = "registration" port = 32325 try: so = SocketHandler('localhost', port) except RuntimeError as err: print err if exists("login.dat") == True: print("auth file is there") if not so.auth_stayLogedIn(): print "error in auth with file" exit() else: window_def = "registration" ## GUI MainWindowForm_Login, MainWindowBase_Login = PyQt4.uic.loadUiType('LogInScreen_v1.1.ui') MainWindowForm_Home, MainWindowBase_Home = PyQt4.uic.loadUiType('Homescreen_v1.2.ui')
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime import time from libinfoclient import SocketHandler import sys #port = int(sys.argv[1]) port = 32325 try: so = SocketHandler('localhost', port) except RuntimeError as err: print err if not so.auth("gu", "ga", False): print "error in auth" exit() #if so.write_group_message("meop", str(datetime.time(datetime.now()))): # print "geht" #else: # print "fail" #messages = so.get_messages("1") #print messages #counter = 0