daboide Commit
Revision 713
Date: 2006-12-17 14:25:58 -0800 (Sun, 17 Dec 2006)
Author: Carl

Changed:
U   trunk/wizards/AppWizard/AppWizard.py
U   trunk/wizards/AppWizard/spec-main.py.txt

Log:
replace blokc of generated code wiht call to app.startupForms()
added code to create go.sh, a shell script that runs the main py script.


Diff:
Modified: trunk/wizards/AppWizard/AppWizard.py
===================================================================
--- trunk/wizards/AppWizard/AppWizard.py        2006-12-16 22:29:22 UTC (rev 
712)
+++ trunk/wizards/AppWizard/AppWizard.py        2006-12-17 22:25:58 UTC (rev 
713)
@@ -849,12 +849,23 @@
                        for d in ("biz", "db", "ui", "resources", "reports"):
                                if not os.path.exists(d):
                                        os.mkdir(d)
+               
+                       tableName = selTb[0].title()
+                       formOpenString = "\"Frm%s\" % form_name"
 
                        ## Create the main script:
                        f = open("./%s.py" % appName, "w")
                        f.write(self.getMain(ci.Name, selTb[0]))
                        f.close()
 
+                       ## Create a shell script to run the main script:
+                       f = open("./go.sh", "w")
+                       f.write( "cd %s\n" % self.outputDirectory )
+                       f.write( "python %s.py %s\n" % (appName, tableName))
+                       f.close()
+                       import stat
+                       os.chmod('go.sh',stat.S_IRWXU )  ## rwx for user, 
nothing else.
+
                        ## Create the manifest file (for xp theme support):
                        pth = os.path.join(self.Application.HomeDirectory, 
"spec-main.exe.manifest")
                        txt = open(pth).read() % dabo.defaultEncoding

Modified: trunk/wizards/AppWizard/spec-main.py.txt
===================================================================
--- trunk/wizards/AppWizard/spec-main.py.txt    2006-12-16 22:29:22 UTC (rev 
712)
+++ trunk/wizards/AppWizard/spec-main.py.txt    2006-12-17 22:25:58 UTC (rev 
713)
@@ -39,21 +39,12 @@
 app.dbConnection = app.getConnectionByName("%(dbConnectionDef)s")
 
 # Open one or more of the defined forms. A default one was picked by the app
-# generator, but you can change that here. Additionally, if form names were 
+# generator. Additionally, if form names were 
 # passed on the command line, they will be opened instead of the default one
 # as long as they exist.
-default_form = ui.Frm%(tableName)s
-formsToOpen = []
-form_names = [class_name[3:] for class_name in dir(ui) if class_name[:3] == 
"Frm"]
-for arg in sys.argv[1:]:
-  arg = arg.lower()
-  for form_name in form_names:
-    if arg == form_name.lower():
-      formsToOpen.append(getattr(ui, %(formOpenString)s))
-if not formsToOpen:
-  formsToOpen.append(default_form)
-for frm in formsToOpen:
-  frm(app.MainForm).show()
+app.default_form = ui.Frm%(tableName)s
+# app.formsToOpen=[ui.FrmMyForm]
+app.startupForms()
 
 # Start the application event loop:
 app.start()




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to