forked from entropy1337/infernal-twin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
project_form (copy).py
110 lines (62 loc) · 2.92 KB
/
project_form (copy).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
99
100
101
102
103
104
105
106
107
108
import wx
import infernal_wireless_gui_project
import os
class Example(wx.Frame):
def __init__(self, parent, title):
super(Example, self).__init__(parent, title=title,
size=(600, 400))
self.InitUI()
self.Centre()
self.Show()
global MultiLine
isProject = False
global projectName
def InitUI(self):
panel = wx.Panel(self)
self.quote = wx.StaticText(panel,-1, label="PROJECT DETAILS \n", pos=(10, 30))
self.quote.SetForegroundColour((255,0,0)) # set text color
#~ prjBtn = wx.Button(panel, -1, "Create a Project",size=(150,30), pos=(10,650))
#~ prjBtn.Bind(wx.EVT_BUTTON, self.create_project)
panel.SetBackgroundColour('#4f5049')
#vbox = wx.BoxSizer(wx.VERTICAL)
self.projectname = wx.TextCtrl(panel, -1, "Project Name",size=(250,30), pos=(10,120))
#self.projectname.SetBackgroundColour('#ededed')
self.author = wx.TextCtrl(panel, -1, "Author's Full Name'",size=(250,30), pos=(10,160))
#self.author.SetBackgroundColour('#ededed')
self.targetname = wx.TextCtrl(panel, -1, "Target Name",size=(250,30), pos=(10,200))
#self.targetname.SetBackgroundColour('#ededed')
self.datename = wx.TextCtrl(panel, -1, "dd/mm/yy",size=(250,30), pos=(10,240))
#self.targetname.SetBackgroundColour('#ededed')
prjBtn = wx.Button(panel, -1, "Create a Project",size=(150,30), pos=(10,300))
prjBtn.Bind(wx.EVT_BUTTON, self.create_project)
prjBtn2 = wx.Button(panel, -1, "Stand alone",size=(150,30), pos=(10,350))
prjBtn2.Bind(wx.EVT_BUTTON, self.create_std)
#~ vbox.Add(self.MultiLine, -1,10)
#~ vbox.Add(prjBtn,-1, border=10)
#~ panel.SetSizer(vbox)
def create_project(self, e):
isProject = True
print isProject
self.projectName = self.projectname.GetValue()
#print self.projectName
dic_project = {"Project":str(self.projectName),"Authors Full Name":str(self.author.GetValue()),"Target name":str(self.targetname.GetValue()),"Date":str(self.datename.GetValue())}
os.system("mkdir %s"%str(self.projectName).replace(" ","_"))
dic_project['Filename']=str(self.projectName).replace(" ","_")
pFile = open(self.projectName.replace(" ","_")+"/Project Info.txt","wb")
pFile.write(str(dic_project))
pFile.close()
infernal_wireless_gui_project.main()
def create_std(self, e):
isProject = False
print isProject
#print self.projectName
infernal_wireless_gui_project.main()
def returnproject(self):
return self.projectName
#if __name__ == '__main__':
def create_new_project():
app = wx.App()
Example(None, title='Create A project')
app.MainLoop()
if __name__ == '__main__':
create_new_project()