packages pyinstaller-1.4.svn20100428-gui.patch
      Pages: < 1 >  DOWNLOAD      
--- trunk/McGUI.py	2005-09-03 17:10:08.000000000 +0200
+++ trunk.new/McGUI.py	2010-04-29 23:25:17.000000000 +0200
@@ -1,10 +1,12 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 # Tkinter interface to the McMillan installer
 # (c) 2003 Alan James Salmoni - yes, all this bad code is all mine!!!
 # released under the MIT license
 
 import os, os.path
+import sys
 from Tkinter import *
 import tkFileDialog
 import FileDialog
@@ -12,26 +14,47 @@
 class McGUI:
     def __init__(self):
         root = Tk()
+        root.iconbitmap("@"+os.path.dirname(sys.argv[0])+os.sep+"pyinstaller.xbm")
+        root.title("PyInstaller")
         fr1 = Frame(root)
-        fr1["width"] = 200
+        fr1["width"] = 300
         fr1["height"] = 100
         fr1.pack(side="top")
+        fr6 = Frame(root)
+        fr6["width"] = 300
+        fr6["height"] = 100
+        fr6.pack(side="top")
+        fr5 = Frame(root)
+        fr5["width"] = 300
+        fr5["height"] = 100
+        fr5.pack(side="top")
         fr2 = Frame(root)
-        fr2["width"] = 200
+        fr2["width"] = 300
         fr2["height"] = 300
         fr2["borderwidth"] = 2
         fr2["relief"] = "ridge"
         fr2.pack()
         fr4 = Frame(root)
-        fr4["width"]=200
+        fr4["width"]=300
         fr4["height"]=100
         fr4.pack(side="bottom")
         getFileButton = Button(fr1)
-        getFileButton["text"] = "Script..."
+        getFileButton["text"] = "Script to bundle..."
         getFileButton.bind("<Button>",self.GetFile)
         getFileButton.pack(side="left")
         self.filein = Entry(fr1)
         self.filein.pack(side="right")
+        label = Label(fr6)
+        label["text"] = "Project name: "
+        label.pack(side="left")
+        self.n = Entry(fr6)
+        self.n.pack(side="right")
+        getDirButton = Button(fr5)
+        getDirButton["text"] = "Output directory..."
+        getDirButton.bind("<Button>",self.GetDir)
+        getDirButton.pack(side="left")
+        self.dirout = Entry(fr5)
+        self.dirout.pack(side="right")
         self.filetypecheck = Checkbutton(fr2)
         self.filetypecheck["text"] = "One File Package                 "
         self.filetype = IntVar()
@@ -52,49 +75,85 @@
         self.debug = IntVar()
         self.debugcheck["variable"] = self.debug
         self.debugcheck.pack()
-        self.noconsolecheck = Checkbutton(fr2)
-        self.noconsolecheck["text"] = "No console (Windows only)"
-        self.noconsole = IntVar()
-        self.noconsolecheck["variable"] = self.noconsole
-        self.noconsolecheck.pack()
+        if sys.platform[:3] != 'win':
+	  self.stripcheck = Checkbutton(fr2)
+	  self.stripcheck["text"] = "Strip the exe and shared libs  "
+	  self.strip = IntVar()
+	  self.stripcheck["variable"] = self.strip
+	  self.stripcheck.pack()
+        self.upxcheck = Checkbutton(fr2)
+        self.upxcheck["text"] = "use UPX if available             "
+        self.upx = IntVar()
+        self.upxcheck["variable"] = self.upx
+        self.upxcheck.pack()
+        if sys.platform[:3] == 'win':
+	  self.noconsolecheck = Checkbutton(fr2)
+	  self.noconsolecheck["text"] = "No console (Windows only)"
+	  self.noconsole = IntVar()
+	  self.noconsolecheck["variable"] = self.noconsole
+	  self.noconsolecheck.pack()
         okaybutton = Button(fr4)
         okaybutton["text"] = "Okay   "
-        okaybutton.bind("<Button>",self.makePackage)
+        okaybutton.bind("<Button>", self.makePackage)
         okaybutton.pack(side="left")
         cancelbutton = Button(fr4)
         cancelbutton["text"] = "Cancel"
-        cancelbutton.bind("<Button>",self.killapp)
+        cancelbutton.bind("<Button>", self.killapp)
         cancelbutton.pack(side="right")
         self.fin = ''
+        self.dout = ''
         self.fout = ''
+        self.name = ''
+        ws = root.winfo_screenwidth()
+	hs = root.winfo_screenheight()
+	x = (ws/2) - (400/2)
+	y = (hs/2) - (250/2)
+	root.geometry('%dx%d+%d+%d' % (400, 250, x, y))
         root.mainloop()
+	
 
     def killapp(self, event):
         sys.exit(0)
 
     def makePackage(self, event):
-        commands = 'python Makespec.py '
-        if (self.filetype.get() == 1):
-            commands = commands + '--onefile '
-        if (self.tk.get() == 1):
-            commands = commands + '--tk '
-        if (self.ascii.get() == 1):
-            commands = commands + '--ascii '
-        if (self.debug.get() == 1):
-            commands = commands + '--debug '
-        if (self.noconsole.get() == 1):
-            commands = commands + '--noconsole '
-        commands = commands + self.fin
+        commands = 'pyi-Makespec '
+        if self.filetype.get() == 1:
+            commands += '--onefile '
+        if self.tk.get() == 1:
+            commands += '--tk '
+        if self.ascii.get() == 1:
+            commands += '--ascii '
+        if self.debug.get() == 1:
+            commands += '--debug '
+        if sys.platform[:3] != 'win' and self.strip.get() == 1:
+            commands += '--strip '  
+        if sys.platform[:3] == 'win' and self.noconsole.get() == 1:
+            commands += '--noconsole ' 
+        if self.dout != '':
+	    commands += '--out=' + self.dout + ' '
+	if self.name != os.path.splitext(os.path.basename(self.fin))[0]:
+	    commands += '--name=' + self.name + ' '
+        commands += self.fin
         x = os.path.split(self.fin)
         y = os.path.splitext(x[1])
         os.system(commands)
-        commands = 'python Build.py '+str(y[0])+os.sep+str(y[0])+'.spec'
+        if self.dout == '':
+	    self.dout = os.getcwd()
+        commands = 'pyi-Build '+self.dout+os.sep+self.name+'.spec'
         os.system(commands)
         sys.exit(0)
 
     def GetFile(self, event):
         self.fin = tkFileDialog.askopenfilename()
-        self.filein.insert(0,self.fin)
+        self.filein.insert(0, self.fin)
+        self.name = os.path.splitext(os.path.basename(self.fin))[0]
+        self.n.insert(0, self.name)
+        self.dout = os.path.dirname(self.fin)
+        self.dirout.insert(0, self.dout)
+        
+    def GetDir(self, event):
+        self.dout = tkFileDialog.askdirectory()
+        self.dirout.insert(0, self.dout)
 
 if __name__ == "__main__":
     app = McGUI()