Пример #1
0
def test_local():
    vfsurl = "vfs://<localtest>/home/smulloni/workdir/skunkweb/test/vfs/libs"
    sys.path.append(vfsurl)
    vfs.VFSRegistry['localtest'] = vfs.LocalFS()
    importer.install()
    do_imports()
    importer.uninstall()
Пример #2
0
    def __reallyload(self):
        havelocal = self.__fsclass == vfs.LocalFS
        docmount = get_product_path(self.name)
        if havelocal:
            newfs = vfs.LocalFS(os.path.join('%s/' % self.file, self.docroot))
            libdir = normpath2('%s/%s' % (self.file, self.libs))
            if os.path.exists(libdir) and libdir not in sys.path:
                sys.path.append(libdir)
        # if using Python 2.3 or better, using zipimport
        elif self.format == '.zip' and sys.version_info >= (2, 3):
            libdir = '%s/%s' % (self.file, self.libs)
            sys.path.append(libdir)
            newfs = self.__fsclass(self.file, root=self.docroot)
        else:
            newfs = self.__fsclass(self.file, root=self.docroot)
            libfs = self.__fsclass(self.file, root=self.libs)
            # if the libfs is empty, don't bother installing it
            if libfs.listdir('/'):
                k = vfs.registerFS(libfs, self.name)
                vfs.importer.install()
                sys.path.append('vfs://<%s>/' % k)
        self.__targetfs.mount(newfs, ProductMountPoint(docmount))

        # this will import services even if they are not contained in
        # the product itself; I'm unclear at this point whether that is
        # good or not
        for service in self.services:
            __import__(service)
Пример #3
0
def _test():
    # this only works for me, sorry
    vfsurl = 'vfs://<localtest>/home/smulloni/workdir/pycomposer/'
    import sys
    sys.path.append(vfsurl)
    vfs.VFSRegistry['localtest'] = vfs.LocalFS()
    install()
    try:
        import series
        print "success!"
    except:
        print "failed!"

    uninstall()
Пример #4
0
import skunklib
_normpath = skunklib.normpath

PYCODE_CACHEFILE_VERSION = 1
DT_CACHEFILE_VERSION = 1
CATALOG_CACHEFILE_VERSION = 1
COMPONENT_CACHEFILE_VERSION = 1

Configuration = cfg.Configuration

#config variables
Configuration.mergeDefaults(
    documentRoot='/usr/local/skunk/docroot',
    compileCacheRoot='/usr/local/skunk/compileCache',
    componentCacheRoot='/usr/local/skunk/compCache',
    documentRootFS=vfs.LocalFS(),
    numServers=0,
    failoverComponentCacheRoot='/usr/local/skunk/failoverCache',
    maxDeferStale=3600,  # 1 hour
    deferAdvance=30,  # how long to extend the life of a deferred component cache
    failoverRetry=
    30,  # how long should we use failover before checking NFS again
    useCompileMemoryCache=1,
    findCommand='/usr/bin/find',
    sedCommand='/bin/sed',
    xargsCommand='/usr/bin/xargs',
    fgrepCommand='/bin/fgrep',
    runOutOfCache=0,
    dontCacheSource=0,
    noTagDebug=0,
    writeKeyFiles=0,
Пример #5
0
import cfg
import vfs

PYCODE_CACHEFILE_VERSION = 1
DT_CACHEFILE_VERSION = 1
CATALOG_CACHEFILE_VERSION = 1
COMPONENT_CACHEFILE_VERSION = 1

Configuration = cfg.Configuration

#config variables
Configuration._mergeDefaultsKw(
    documentRoot='/usr/local/skunk/docroot',
    compileCacheRoot='/usr/local/skunk/compileCache',
    componentCacheRoot='/usr/local/skunk/compCache',
    documentRootFS=[vfs.LocalFS()],
    numServers=0,
    failoverComponentCacheRoot='/usr/local/skunk/failoverCache',
    maxDeferStale=3600,  # 1 hour
    deferAdvance=30,  # how long to extend the life of a deferred component cache
    failoverRetry=
    30,  # how long should we use failover before checking NFS again
    useCompileMemoryCache=0,
    findCommand='/usr/bin/find',
    sedCommand='/bin/sed',
    xargsCommand='/usr/bin/xargs',
    fgrepCommand='/bin/fgrep')
#/config

tagRegistry = DT.DTTagRegistry.get_standard_tags()
compileMemoryCache = {}