Chris, all:

Found the problem: there is a bug in turbogears/command/base.py.  The
SQL class always assumes it is working on a development tree, so it
fails on a non-development project.

My patch to fix it (against TG 1.0.2.2):

--- turbogears/command/base.py.original 2007-05-31 15:25:31.000000000
-0700
+++ turbogears/command/base.py  2007-05-31 20:25:10.000000000 -0700
@@ -129,16 +129,21 @@

             if sqlobjcommand not in no_model_param:
                 if not "--egg" in sys.argv:
-                    eggname = glob.glob("*.egg-info")
-                    if not eggname or not \
-                        os.path.exists(os.path.join(eggname[0],
"sqlobject.txt")):
-                        eggname = self.fix_egginfo(eggname)
-                    eggname = eggname[0].replace(".egg-info", "")
-                    if not "." in sys.path:
-                        sys.path.append(".")
-                        pkg_resources.working_set.add_entry(".")
-                    sys.argv.insert(2, eggname)
-                    sys.argv.insert(2, "--egg")
+                    #eggname = glob.glob("*.egg-info")
+                    eggname = turbogears.util.get_project_name()
+                    if eggname:
+                        sys.argv.insert(2, eggname)
+                        sys.argv.insert(2, "--egg")
+                    else:
+                        if not \
+                            os.path.exists(os.path.join(eggname[0],
"sqlobject.txt")):
+                            eggname = self.fix_egginfo(eggname)
+                        eggname = eggname[0].replace(".egg-info", "")
+                        if not "." in sys.path:
+                            sys.path.append(".")
+                            pkg_resources.working_set.add_entry(".")
+                        sys.argv.insert(2, eggname)
+                        sys.argv.insert(2, "--egg")

             from sqlobject.manager import command
             command.the_runner.run(sys.argv)

If this patch needs its own discussion thread, testing, etc., before
acceptance, let me know.

Andrew

On May 30, 9:29 pm, Christopher Arndt <[EMAIL PROTECTED]> wrote:
>
> I was pondering over that problem for a while now too, and I was about
> to write a section about this on the DeployWithAnEgg page on the doc
> wiki. I haven't finished the text, so I haven't uploaded it yet, but as
> it answers some of your questions, I'll post it here in advance.
>
> HTH, Chris


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to