-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyvir.py
98 lines (80 loc) · 3.68 KB
/
pyvir.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyvir.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
from display import q1
import venv, os
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(543, 317)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setGeometry(QtCore.QRect(20, 10, 231, 251))
self.frame.setFrameShape(QtWidgets.QFrame.Box)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame")
self.label = QtWidgets.QLabel(self.frame)
self.label.setGeometry(QtCore.QRect(10, 10, 161, 18))
self.label.setObjectName("label")
#Display envs
self.listWidget = QtWidgets.QListWidget(self.frame)
self.listWidget.setGeometry(QtCore.QRect(10, 40, 200, 200))
self.listWidget.setObjectName("listWidget")
self.listWidget.addItems(q1[0:])
self.frame_2 = QtWidgets.QFrame(self.centralwidget)
self.frame_2.setGeometry(QtCore.QRect(290, 10, 231, 251))
self.frame_2.setFrameShape(QtWidgets.QFrame.Box)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_2.setObjectName("frame_2")
self.label_2 = QtWidgets.QLabel(self.frame_2)
self.label_2.setGeometry(QtCore.QRect(10, 10, 181, 18))
self.label_2.setObjectName("label_2")
#get env name here
self.lineEdit = QtWidgets.QLineEdit(self.frame_2)
self.lineEdit.setGeometry(QtCore.QRect(10, 30, 201, 31))
self.lineEdit.setObjectName("lineEdit")
#self.env_name = self.lineEdit.text()
#virenv makes here
self.pushButton = QtWidgets.QPushButton(self.frame_2)
self.pushButton.setGeometry(QtCore.QRect(60, 190, 111, 41))
self.pushButton.setObjectName("pushButton")
self.pushButton.clicked.connect(self.create_venv)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 543, 23))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label.setText(_translate("MainWindow", "Virtual Environments"))
self.label_2.setText(_translate("MainWindow", "Make Virtual envs Here"))
self.pushButton.setText(_translate("MainWindow", "Make it!"))
def create_venv(self):
os.chdir('/home/diaoko/venv')
try:
#venv.create("/home/diaoko/venv/"+(str(self.env_name)))
venv.create("/home/diaoko/venv/"+(str(self.lineEdit.text())))
except FileExistsError:
pass
'''
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
'''