def __init__(self, main_server_address=None, user_data=None): if (main_server_address): self.main_server_address = main_server_address else: self.main_server_address = ('localhost', 56789) self.dtp_server_address = None self.logger = Protocol.Logger() self.parser = Protocol.Parser(module=Protocol) self.user_data = None self.sock = None self.data_sock = None self.book_data = None
# -*- coding: utf-8 -*- from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import * import sys import socket import Protocol logger = Protocol.Logger() parser = Protocol.Parser(module=Protocol) class ELibraryWidget(QMainWindow): def __init__(self,server_address,user_data=None,parent=None): super().__init__(parent=parent) self.initUI() self.user_data = user_data self.server_address = server_address self.loadBookList() def initUI(self): self.setGeometry(100,100,600,700) self.listbox = QListWidget(self) self.listbox.setGeometry(50,100,300,500) book1 = QListWidgetItem("test book") self.listbox.addItem(book1) self.borrow_btn = QPushButton("대출",self) self.borrow_btn.move(400,100) self.borrow_btn.resize(self.borrow_btn.sizeHint()) self.borrow_btn.clicked.connect(self.borrow_book)