unless I've messed something, this is the usual python behavior for
loading modules.  The problem is that your Root is not in your sys
path.  You could add it to your path, it in your index.psp you could do
something like

<%
import sys
if [ull path to root] not in sys.path:
    sys.path.append([full path to root])
%>

That should add root to your sys path then
<%@ page imports="FyreSite:FyreSite"%>
should work fine.

mind you the code is untested but ti should work

Jose
> -------- Original Message --------
> Subject: [Webware-discuss] Subdirectories
> From: "Lethalman" <[EMAIL PROTECTED]>
> Date: Sun, October 31, 2004 6:00 am
> To: [EMAIL PROTECTED]
>
> (first sorry for my poor English)
> Webware is the best python framework for me, great job!
>
> This is my problem.
> I'm trying to connect some psp/servlets from a subdirectory to the root
> directory, but i can't import some modules.
> For example:
> Root/
> - FyreSite.py
> - index.psp
> - database/
> --- Config.fs
> --- DB.fs
> - admin/
> --- Admin_Panel.py
> --- index.psp
>
> Now, when i try to get admin/index.psp i can't import the class FyreSite
> from FyreSite.py and extend the PSP page for FyreSite and Admin_Panel
> I'm trying to find any solution to solve this stupid problem...
> This is the header of admin/index.psp:
> <%@ page imports="sys,os"%>
> <%
> self.dir = os.path.split(os.path.split(self.serverSidePath())[0])[0]
> sys.path.insert(0, self.dir)
> %>
> <%@ page imports="FyreSite:FyreSite"%>
> <%@ page extends="FyreSite,Admin_Panel"%>
> ...
>
> But it can't find the module named FyreSite... so i tried:
> ...
> sys.path.insert(0, self.dir)
> from FyreSite import FyreSite
> %>
> <%@ page extends="FyreSite,Admin_Panel"%>
>
> And it doesn't work... really i would like to extend Admin_Panel to
> FyreSite:
> class Admin_Panel(FyreSite)
>
> then extend admin/index.psp to Admin_Panel:
> <%@ page extends="Admin_Panel"%>
>
> But i can't extend Admin_Panel to FyreSite first because i haven't
> self.serverSidePath()
>
> Is there an alternative against copying FyreSite.py to each subdirectory
> or set a prefix Admin_ to each file then bring them to the Root
> directory and remove the subdirectories?
>
> Please help me...
>
> --
> Fyrebird Hosting Provider - Technical Department
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to