]> granicus.if.org Git - python/commitdiff
Automatically dump distribution folders where I want them, next to the vise scripts.
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 5 May 2000 23:07:43 +0000 (23:07 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 5 May 2000 23:07:43 +0000 (23:07 +0000)
Mac/scripts/MkDistr.py
Mac/scripts/MkDistr_ui.py

index a9c79374d4739cd6e90b6d0be2efe06397d18ac5..028a4224574d83f88cf453fc53980c6df0fcef71 100644 (file)
@@ -208,15 +208,12 @@ class Main:
        
        def __init__(self):
                InitUI()
-               fss, ok = macfs.GetDirectory('Source directory:')
-               if not ok:
-                       sys.exit(0)
-               os.chdir(fss.as_pathname())
+               os.chdir(sys.prefix)
                if not os.path.isdir(':Mac:Distributions'):
                        os.mkdir(':Mac:Distributions')
-               typedist = GetType()
-               self.inc = IncMatcher(':Mac:Distributions:%s.include'%typedist)
-               self.exc = ExcMatcher(':Mac:Distributions:%s.exclude'%typedist)
+               self.typedist = GetType()
+               self.inc = IncMatcher(':Mac:Distributions:%s.include'%self.typedist)
+               self.exc = ExcMatcher(':Mac:Distributions:%s.exclude'%self.typedist)
                self.ui = MkDistrUI(self)
                self.ui.mainloop()
                
@@ -259,7 +256,7 @@ class Main:
                        rv = rv + self.checkdir(d, 0)
                return rv
                
-       def run(self, destprefix):
+       def run(self):
                missing = self.inc.checksourcetree()
                if missing:
                        print '==== Missing source files ===='
@@ -267,6 +264,8 @@ class Main:
                                print i
                        print '==== Fix and retry ===='
                        return
+               destprefix = os.path.join(sys.prefix, ':Mac:Distributions:vise')
+               destprefix = os.path.join(destprefix, '%s Distribution'%self.typedist)
                if not self.rundir(':', destprefix, 0):
                        return
                self.rundir(':', destprefix, 1)
index babd156c5616ca346f87e6d73a167f57e9d10025..f0be72b1424c055668ab31b003ec6349ee8c61c6 100644 (file)
@@ -183,14 +183,8 @@ class MainListWindow(ListWindow):
                if item == MAIN_LIST:
                        self.do_listhit(event)
                if item == MAIN_MKDISTR:
-## XXXX Why doesn't this work??!?!?
-##                     fss, ok = macfs.StandardPutFile('Destination folder?')
-##                     if not ok:
-##                             return
-##                     dest = fss.as_pathname()
-                       dest = os.path.join(os.getcwd(), 'Distribution')
                        setwatchcursor()
-                       self.cb_run(dest)
+                       self.cb_run()
                        setarrowcursor()
                if item == MAIN_CHECK:
                        setwatchcursor()