Demo entry 6632774

main.py

   

Submitted by Chianti Blaze on Jul 30, 2017 at 08:17
Language: Python 3. Code size: 1.3 kB.

# CPAP starting from July 28, 2017
"""
dependencies:
pip install google-api-python-client
pip install pyqt5

"""


from PyQt5.QtWidgets import QApplication, QWidget, QLabel
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import Qt
import sys

# Custom Modules
from core.panel import UI_CommandPanel, UI_HomePanel
from core import linker, Seed

class CPAP(QWidget):
	def __init__(self):
		super().__init__()
		# self.UI_commandPanel()
		self.initUI()
		self.initSeed()
		self.mainPanel = UI_HomePanel(self)
		self.command = UI_CommandPanel(self)
		
		
		self.show()

	def initUI(self):
		self.setWindowTitle("CPAP Beta")
		"""
			fullsize: 270x400
			displayPanel: 270x350
			commandPanel : 270x30
		"""
		self.setFixedSize(270, 400)
		self.background = QLabel("", self)
		self.background.setPixmap(QPixmap("core/UI/HomePanel/wall.png"))
		self.background.resize(270,400)
		self.background.move(0,0)
		self.background.show()

	def initSeed(self):
		self.seed = Seed()

	def keyPressEvent(self, event):
		if event.key() == Qt.Key_Return and self.command.text() != "":
			# When pressed enter, execute command
			linker(self.command.text(), self)



if __name__ == "__main__":
	app = QApplication(sys.argv)
	cpap = CPAP()
	sys.exit(app.exec_())

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).