Dear all,

I have been struggling with some contextes that I have not been able to
load and the folling issues have come up.  One I finally solved myself,
however the other I put the group for consideration  

1) On Windows to add a context which is found on a network drive you
have to use UNC names to mount the context.  For example if there is a
share called //server/share/context you could add the contect in your
config files as such:
        'contect':     '//server/share/context'
However to do this you must do two things:
        1 ) run the webkit service as a user not system (the users
rights will be used to determin if you can have access to the network
folder that you want
        2) modify application.py to handle unc based contexts.
Specifically you must modify the addContext method in the Application
class from :

        def addContext(self, name, dir):
                if self._contexts.has_key(name):
                        print 'WARNING: Overwriting context %s (=%s)
with %s' % (
                                repr(name), repr(self._contexts[name]),
repr(dir))
                        __contextInitialized = 1 # Assume already
initialized.
                else:
                        __contextInitialized = 0
                        
                try:
                        importAsName = name
                        localdir, pkgname = os.path.split(dir)
                        if sys.modules.has_key(importAsName):
                                mod = sys.modules.get(importAsName)
                        else:
                                res = imp.find_module(pkgname,
[localdir])
                                mod = imp.load_module(name, res[0],
res[1], res[2])
                                __contextInitialized = 0  # overwriting
context - re-initialize
                                
                except ImportError,e:
                        print "Error loading context: %s: %s: dir=%s" %
(name, e, dir)
                        return

TO:

        def addContext(self, name, dir):
                if self._contexts.has_key(name):
                        print 'WARNING: Overwriting context %s (=%s)
with %s' % (
                                repr(name), repr(self._contexts[name]),
repr(dir))
                        __contextInitialized = 1 # Assume already
initialized.
                else:
                        __contextInitialized = 0
                        
                try:
                        importAsName = name
                        
                        if dir.startswith('//'): #look for UNC style
path
                                localdir, pkgname =
os.path.splitunc(dir) # split for UNC paths
                                pkgname = pkgname[1:] #eliminates the
'/' at the beginning of this value
                        else:
                                localdir, pkgname = os.path.split(dir)
# original code
                        if sys.modules.has_key(importAsName):
                                mod = sys.modules.get(importAsName)
                        else:
                                res = imp.find_module(pkgname,
[localdir])
                                mod = imp.load_module(name, res[0],
res[1], res[2])
                                __contextInitialized = 0  # overwriting
context - re-initialize
                                
                except ImportError,e:
                        print "Error loading context: %s: %s: dir=%s" %
(name, e, dir)
                        return

Now note that my context was //server/share/context and not
//server/share  because this does not work which brings me to my second
point.  

2)  How do you add a root level context?  I realise that most people
will not want to do this, and the only reason it came up for me was that
I was trying to add a context which was part of a network drive.  I also
realise that is most likely a windows issue since only windows is stupid
enough to add network recourses in this fashion (I know on linix when
you mount a network drive it becomes attached to a mount point which can
not be the root level).  In any event is it possible to add a root level
context?

Thanks for any and all imput

Jose




-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to