List Info

Thread: My sys.path does not look right in my traceback




My sys.path does not look right in my traceback
user name
2006-04-17 18:53:53
Hi all!  I'm very new to pylons (couple of days off and
on), and have
run into a bit of a problem.

I'm attempting to use a myghty module component via
`Component Call
With Content' .  The component call looks something like
this ->

<&| order:formfill, defaults=defaults, errors=errors
&>

 ... some stuff ...

</&>

But I get an error:

Error:  	Error(ImportError): No module named order

Well, I wanted to stick the `formfill' function inside the
controller
that is actually handling the order form.  So, I did just
that .

But, pylons can't find the order module and I think it is
because my
sys.path is screwed up.  Below is the sys.path entry that I
think is
causing the problem:

'C:\\cygwin\\tmp\\pylons-sandbox\\helloworld\\hel
loworldC:\\cygwin\\tmp\\pylons-sandbox\\helloworld\
\helloworld/controllers'

I think it should read:
'C:\\cygwin\\tmp\\pylons-sandbox\\helloworld\\hel
loworld/controllers'

And this is the line in my routing.py that is setting this
up -
    map = Mapper(directory = root_path + '/controllers')

I just don't understand how the path is getting screwed up.
  If I
can't figure it out, I can always stick it in my project's
`lib'
directory, which shows up in sys.path correctly.  But, I'd
rather avoid
that if possible.  Another alternative is just to use the
`project'
package, to drill down to my controller -
`helloworld.controllers.order'  But at this point, I'm
wondering if
I've screwed up my configuration somehow, and I don't
realize it.

Any ideas?
jw


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

My sys.path does not look right in my traceback
user name
2006-04-17 20:34:55
You can add the controllers dir to your search path by
editing
yourproj/config/environment.py. Near the top is a line that
inserts
several paths into the sys path like models and lib.

Just add 'controllers' to it, and what you're doing
should work.

HTH,
Ben


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

My sys.path does not look right in my traceback
user name
2006-04-17 20:59:32
programmer.py wrote:
> And this is the line in my routing.py that is setting
this up -
>     map = Mapper(directory = root_path +
'/controllers')

It also appears that this line should've been done with
os.path.join to
avoid using a unix specific directory path (the / instead of
\). I've
added a ticket for this so I remember to patch it when I
have time.

- Ben


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

My sys.path does not look right in my traceback
user name
2006-04-18 12:31:02
Thanks a bunch for your help!

jw


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )