vue
This commit is contained in:
		
							
								
								
									
										29
									
								
								client/client.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								client/client.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| from socket import * | ||||
|  | ||||
| Host = "127.0.0.1" | ||||
| Port = 2222 | ||||
| Addr = (Host,Port) | ||||
|  | ||||
| def Client(): | ||||
| 	s = socket(AF_INET,SOCK_STREAM); | ||||
| 	s.connect(Addr); | ||||
|  | ||||
| 	while True : | ||||
| 			cmd = input("Entrez votre commande (help pour la liste des commandes et quit pour quitter) : ") | ||||
| 			if cmd.lower() == "quit": | ||||
| 				break | ||||
| 			try : | ||||
| 				s.send(cmd.encode()) | ||||
| 				#data , addr = s.recvfrom(4096) | ||||
| 				#print(data.decode()) | ||||
| 			except timeout : | ||||
| 				print("Erreur : Timeout. Le serveur ne repond pas.") | ||||
| 			 | ||||
| 	s.close(); | ||||
|  | ||||
|  | ||||
| if __name__ == "__main__": | ||||
| 	Client() | ||||
|  | ||||
|  | ||||
|  | ||||
							
								
								
									
										
											BIN
										
									
								
								client/view/__pycache__/irc.cpython-34.pyc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								client/view/__pycache__/irc.cpython-34.pyc
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										101
									
								
								client/view/irc.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								client/view/irc.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,101 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
|  | ||||
| # Form implementation generated from reading ui file 'irc.ui' | ||||
| # | ||||
| # Created: Mon Mar 30 12:18:37 2015 | ||||
| #      by: PyQt4 UI code generator 4.11.3 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
|  | ||||
| from PyQt4 import QtCore, QtGui | ||||
|  | ||||
| try: | ||||
|     _fromUtf8 = QtCore.QString.fromUtf8 | ||||
| except AttributeError: | ||||
|     def _fromUtf8(s): | ||||
|         return s | ||||
|  | ||||
| try: | ||||
|     _encoding = QtGui.QApplication.UnicodeUTF8 | ||||
|     def _translate(context, text, disambig): | ||||
|         return QtGui.QApplication.translate(context, text, disambig, _encoding) | ||||
| except AttributeError: | ||||
|     def _translate(context, text, disambig): | ||||
|         return QtGui.QApplication.translate(context, text, disambig) | ||||
|  | ||||
| class Ui_Dialog(object): | ||||
|     def setupUi(self, Dialog): | ||||
|         Dialog.setObjectName(_fromUtf8("Dialog")) | ||||
|         Dialog.resize(675, 540) | ||||
|         self.verticalLayoutWidget = QtGui.QWidget(Dialog) | ||||
|         self.verticalLayoutWidget.setGeometry(QtCore.QRect(500, 100, 160, 361)) | ||||
|         self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget")) | ||||
|         self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget) | ||||
|         self.verticalLayout.setMargin(0) | ||||
|         self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) | ||||
|         self.label = QtGui.QLabel(self.verticalLayoutWidget) | ||||
|         font = QtGui.QFont() | ||||
|         font.setPointSize(16) | ||||
|         font.setBold(True) | ||||
|         font.setWeight(75) | ||||
|         self.label.setFont(font) | ||||
|         self.label.setObjectName(_fromUtf8("label")) | ||||
|         self.verticalLayout.addWidget(self.label) | ||||
|         self.listView = QtGui.QListView(self.verticalLayoutWidget) | ||||
|         self.listView.setObjectName(_fromUtf8("listView")) | ||||
|         self.verticalLayout.addWidget(self.listView) | ||||
|         self.listView_2 = QtGui.QListView(Dialog) | ||||
|         self.listView_2.setGeometry(QtCore.QRect(20, 140, 471, 321)) | ||||
|         self.listView_2.setObjectName(_fromUtf8("listView_2")) | ||||
|         self.horizontalLayoutWidget = QtGui.QWidget(Dialog) | ||||
|         self.horizontalLayoutWidget.setGeometry(QtCore.QRect(20, 470, 641, 61)) | ||||
|         self.horizontalLayoutWidget.setObjectName(_fromUtf8("horizontalLayoutWidget")) | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget) | ||||
|         self.horizontalLayout.setMargin(0) | ||||
|         self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) | ||||
|         self.lineEdit = QtGui.QLineEdit(self.horizontalLayoutWidget) | ||||
|         self.lineEdit.setObjectName(_fromUtf8("lineEdit")) | ||||
|         self.horizontalLayout.addWidget(self.lineEdit) | ||||
|         self.pushButton = QtGui.QPushButton(self.horizontalLayoutWidget) | ||||
|         self.pushButton.setObjectName(_fromUtf8("pushButton")) | ||||
|         self.horizontalLayout.addWidget(self.pushButton) | ||||
|         self.horizontalLayoutWidget_2 = QtGui.QWidget(Dialog) | ||||
|         self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(20, 30, 641, 41)) | ||||
|         self.horizontalLayoutWidget_2.setObjectName(_fromUtf8("horizontalLayoutWidget_2")) | ||||
|         self.horizontalLayout_2 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_2) | ||||
|         self.horizontalLayout_2.setMargin(0) | ||||
|         self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) | ||||
|         self.lineEdit_2 = QtGui.QLineEdit(self.horizontalLayoutWidget_2) | ||||
|         self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2")) | ||||
|         self.horizontalLayout_2.addWidget(self.lineEdit_2) | ||||
|         self.pushButton_2 = QtGui.QPushButton(self.horizontalLayoutWidget_2) | ||||
|         self.pushButton_2.setObjectName(_fromUtf8("pushButton_2")) | ||||
|         self.horizontalLayout_2.addWidget(self.pushButton_2) | ||||
|         self.pushButton_3 = QtGui.QPushButton(self.horizontalLayoutWidget_2) | ||||
|         self.pushButton_3.setObjectName(_fromUtf8("pushButton_3")) | ||||
|         self.horizontalLayout_2.addWidget(self.pushButton_3) | ||||
|         self.horizontalLayoutWidget_3 = QtGui.QWidget(Dialog) | ||||
|         self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(20, 90, 471, 41)) | ||||
|         self.horizontalLayoutWidget_3.setObjectName(_fromUtf8("horizontalLayoutWidget_3")) | ||||
|         self.horizontalLayout_3 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_3) | ||||
|         self.horizontalLayout_3.setMargin(0) | ||||
|         self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) | ||||
|         self.pushButton_5 = QtGui.QPushButton(self.horizontalLayoutWidget_3) | ||||
|         self.pushButton_5.setObjectName(_fromUtf8("pushButton_5")) | ||||
|         self.horizontalLayout_3.addWidget(self.pushButton_5) | ||||
|         self.pushButton_4 = QtGui.QPushButton(self.horizontalLayoutWidget_3) | ||||
|         self.pushButton_4.setObjectName(_fromUtf8("pushButton_4")) | ||||
|         self.horizontalLayout_3.addWidget(self.pushButton_4) | ||||
|  | ||||
|         self.retranslateUi(Dialog) | ||||
|         QtCore.QMetaObject.connectSlotsByName(Dialog) | ||||
|  | ||||
|     def retranslateUi(self, Dialog): | ||||
|         Dialog.setWindowTitle(_translate("Dialog", "Dialog", None)) | ||||
|         self.label.setText(_translate("Dialog", "Nick list", None)) | ||||
|         self.pushButton.setText(_translate("Dialog", "Send message", None)) | ||||
|         self.pushButton_2.setText(_translate("Dialog", "Connect", None)) | ||||
|         self.pushButton_3.setText(_translate("Dialog", "Disconnect", None)) | ||||
|         self.pushButton_5.setText(_translate("Dialog", "Disable", None)) | ||||
|         self.pushButton_4.setText(_translate("Dialog", "Enable", None)) | ||||
|  | ||||
							
								
								
									
										135
									
								
								client/view/irc.ui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										135
									
								
								client/view/irc.ui
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,135 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ui version="4.0"> | ||||
|  <class>Dialog</class> | ||||
|  <widget class="QDialog" name="Dialog"> | ||||
|   <property name="geometry"> | ||||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>675</width> | ||||
|     <height>540</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
|    <string>Dialog</string> | ||||
|   </property> | ||||
|   <widget class="QWidget" name="verticalLayoutWidget"> | ||||
|    <property name="geometry"> | ||||
|     <rect> | ||||
|      <x>500</x> | ||||
|      <y>100</y> | ||||
|      <width>160</width> | ||||
|      <height>361</height> | ||||
|     </rect> | ||||
|    </property> | ||||
|    <layout class="QVBoxLayout" name="verticalLayout"> | ||||
|     <item> | ||||
|      <widget class="QLabel" name="label"> | ||||
|       <property name="font"> | ||||
|        <font> | ||||
|         <pointsize>16</pointsize> | ||||
|         <weight>75</weight> | ||||
|         <bold>true</bold> | ||||
|        </font> | ||||
|       </property> | ||||
|       <property name="text"> | ||||
|        <string>Nick list</string> | ||||
|       </property> | ||||
|      </widget> | ||||
|     </item> | ||||
|     <item> | ||||
|      <widget class="QListView" name="listView"/> | ||||
|     </item> | ||||
|    </layout> | ||||
|   </widget> | ||||
|   <widget class="QListView" name="listView_2"> | ||||
|    <property name="geometry"> | ||||
|     <rect> | ||||
|      <x>20</x> | ||||
|      <y>140</y> | ||||
|      <width>471</width> | ||||
|      <height>321</height> | ||||
|     </rect> | ||||
|    </property> | ||||
|   </widget> | ||||
|   <widget class="QWidget" name="horizontalLayoutWidget"> | ||||
|    <property name="geometry"> | ||||
|     <rect> | ||||
|      <x>20</x> | ||||
|      <y>470</y> | ||||
|      <width>641</width> | ||||
|      <height>61</height> | ||||
|     </rect> | ||||
|    </property> | ||||
|    <layout class="QHBoxLayout" name="horizontalLayout"> | ||||
|     <item> | ||||
|      <widget class="QLineEdit" name="lineEdit"/> | ||||
|     </item> | ||||
|     <item> | ||||
|      <widget class="QPushButton" name="pushButton"> | ||||
|       <property name="text"> | ||||
|        <string>Send message</string> | ||||
|       </property> | ||||
|      </widget> | ||||
|     </item> | ||||
|    </layout> | ||||
|   </widget> | ||||
|   <widget class="QWidget" name="horizontalLayoutWidget_2"> | ||||
|    <property name="geometry"> | ||||
|     <rect> | ||||
|      <x>20</x> | ||||
|      <y>30</y> | ||||
|      <width>641</width> | ||||
|      <height>41</height> | ||||
|     </rect> | ||||
|    </property> | ||||
|    <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||||
|     <item> | ||||
|      <widget class="QLineEdit" name="lineEdit_2"/> | ||||
|     </item> | ||||
|     <item> | ||||
|      <widget class="QPushButton" name="pushButton_2"> | ||||
|       <property name="text"> | ||||
|        <string>Connect</string> | ||||
|       </property> | ||||
|      </widget> | ||||
|     </item> | ||||
|     <item> | ||||
|      <widget class="QPushButton" name="pushButton_3"> | ||||
|       <property name="text"> | ||||
|        <string>Disconnect</string> | ||||
|       </property> | ||||
|      </widget> | ||||
|     </item> | ||||
|    </layout> | ||||
|   </widget> | ||||
|   <widget class="QWidget" name="horizontalLayoutWidget_3"> | ||||
|    <property name="geometry"> | ||||
|     <rect> | ||||
|      <x>20</x> | ||||
|      <y>90</y> | ||||
|      <width>471</width> | ||||
|      <height>41</height> | ||||
|     </rect> | ||||
|    </property> | ||||
|    <layout class="QHBoxLayout" name="horizontalLayout_3"> | ||||
|     <item> | ||||
|      <widget class="QPushButton" name="pushButton_5"> | ||||
|       <property name="text"> | ||||
|        <string>Disable</string> | ||||
|       </property> | ||||
|      </widget> | ||||
|     </item> | ||||
|     <item> | ||||
|      <widget class="QPushButton" name="pushButton_4"> | ||||
|       <property name="text"> | ||||
|        <string>Enable</string> | ||||
|       </property> | ||||
|      </widget> | ||||
|     </item> | ||||
|    </layout> | ||||
|   </widget> | ||||
|  </widget> | ||||
|  <resources/> | ||||
|  <connections/> | ||||
| </ui> | ||||
							
								
								
									
										34
									
								
								client/view/start.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								client/view/start.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| from irc import Ui_Dialog | ||||
| from PyQt4 import QtGui, QtCore | ||||
|  | ||||
| class start(QtGui.QDialog): | ||||
|  | ||||
|     def __init__(self): | ||||
|         super(start, self).__init__() | ||||
|         self.createWidgets() | ||||
|  | ||||
|     def createWidgets(self): | ||||
|         self.ui = Ui_Dialog() | ||||
|         self.ui.setupUi(self) | ||||
|         #self.connectActions() | ||||
|  | ||||
|     def connectActions(self): | ||||
|         self.ui.pushButton_2.clicked.connect(self.admin) | ||||
|         self.ui.pushButton.clicked.connect(self.client) | ||||
|  | ||||
|     def admin(self): | ||||
|         self.hide() | ||||
|         self.admin = mainAdmin(self) | ||||
|  | ||||
|     def client(self): | ||||
|         self.hide() | ||||
|         self.admin = mainUtilisateur(self) | ||||
|  | ||||
|  | ||||
| if __name__ == "__main__": | ||||
|     import sys | ||||
|     app = QtGui.QApplication(sys.argv) | ||||
|     myapp = start() | ||||
|     myapp.show() | ||||
|     myapp.focusWidget() | ||||
|     sys.exit(app.exec_()) | ||||
		Reference in New Issue
	
	Block a user