• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(93)  |  Call(67)  |  Derive(0)  |  Import(26)
Does the named resource exist?

src/p/y/pythia-0.8.1.11/pyre/inventory/odb/Curator.py   pythia(Download)
        systemDepository = self.setSystemDepository(system)
 
        # create the built-in depositories
        from pkg_resources import resource_listdir, resource_isdir, resource_exists, resource_filename, Requirement
        pythia = Requirement.parse("pythia")
        entries = resource_listdir(pythia, "")
        for entry in entries:
            if resource_isdir(pythia, entry):
                vault = entry + '/__vault__.odb'
                if resource_exists(pythia, vault):

src/y/o/yould-0.3.7/yould/prob.py   yould(Download)
 
from cPickle import load, dump
from pprint import pformat, pprint
from pkg_resources import resource_filename, resource_exists, resource_listdir
from random import random
from collections import deque
from threading import Timer
def find_trainset(name):
    if os.path.isfile(name):
        return load_trainset(name)
    elif resource_exists(trainsets.__name__, name):
        return load_trainset(resource_filename(trainsets.__name__, name))
    elif resource_exists(trainsets.__name__, name+".yould"):
        return load_trainset(resource_filename(trainsets.__name__, name+".yould"))

src/u/l/uliweb-HEAD/uliweb/lib/werkzeug/utils.py   uliweb(Download)
    def get_package_loader(self, package, package_path):
        from pkg_resources import resource_exists, resource_stream
        def loader(path):
            path = posixpath.join(package_path, path)
            if resource_exists(package, path):
                return posixpath.basename(path), \
                       lambda: resource_stream(package, path)

src/j/i/Jinja-1.2/jinja/loaders.py   Jinja(Download)
    def _get_load_func(self):
        if hasattr(self, '_load_func'):
            return self._load_func
        try:
            from pkg_resources import resource_exists, resource_string
            if self.force_native:
                raise ImportError()
            def load_func(name):
                path = '/'.join([self.package_path] + [p for p in name.split('/')
                         if p != '..'])
                if resource_exists(self.package_name, path):
                    return resource_string(self.package_name, path)
        self._load_func = load_func
        return load_func
    def check_source_changed(self, environment, name):
        from pkg_resources import resource_exists, resource_filename
        fn = resource_filename(self.package_name, '/'.join([self.package_path] +
                               [p for p in name.split('/') if p and p[0] != '.']))
        if resource_exists(self.package_name, fn):
            return path.getmtime(fn)
        return -1

src/s/u/sutekh-HEAD/releases/unstable-branches/0.7.x/sutekh/gui/MultiPaneWindow.py   sutekh(Download)
import gtk
# pylint: disable-msg=E0611
# pylint doesn't see resource_stream here, for some reason
from pkg_resources import resource_stream, resource_exists
from itertools import chain
# pylint: enable-msg=E0611
from sutekh.core.SutekhObjectCache import SutekhObjectCache
    def _link_resource(self, sLocalUrl):
        """Return a file-like object which sLocalUrl can be read from."""
        sResource = '/docs/html/%s' % sLocalUrl
        if resource_exists('sutekh', sResource):
            return resource_stream('sutekh', sResource)
        else:
            raise ValueError("Unknown resource %s" % sLocalUrl)

src/s/u/sutekh-HEAD/releases/stable-tags/0.6.4/sutekh/gui/MultiPaneWindow.py   sutekh(Download)
import gtk
# pylint: disable-msg=E0611
# pylint doesn't see resource_stream here, for some reason
from pkg_resources import resource_stream, resource_exists
# pylint: enable-msg=E0611
from sqlobject import SQLObjectNotFound
from sutekh.core.SutekhObjectCache import SutekhObjectCache
    def _link_resource(self, sLocalUrl):
        """Return a file-like object which sLocalUrl can be read from."""
        sResource = '/docs/html/%s' % sLocalUrl
        if resource_exists('sutekh', sResource):
            return resource_stream('sutekh', sResource)
        else:
            raise ValueError("Unknown resource %s" % sLocalUrl)

src/s/u/sutekh-HEAD/releases/stable-tags/0.6.3/sutekh/gui/MultiPaneWindow.py   sutekh(Download)
import gtk
# pylint: disable-msg=E0611
# pylint doesn't see resource_stream here, for some reason
from pkg_resources import resource_stream, resource_exists
# pylint: enable-msg=E0611
from sqlobject import SQLObjectNotFound
from sutekh.core.SutekhObjectCache import SutekhObjectCache
    def _link_resource(self, sLocalUrl):
        """Return a file-like object which sLocalUrl can be read from."""
        sResource = '/docs/html/%s' % sLocalUrl
        if resource_exists('sutekh', sResource):
            return resource_stream('sutekh', sResource)
        else:
            raise ValueError("Unknown resource %s" % sLocalUrl)

src/s/u/sutekh-HEAD/releases/stable-tags/0.6.2/sutekh/gui/MultiPaneWindow.py   sutekh(Download)
import gtk
# pylint: disable-msg=E0611
# pylint doesn't see resource_stream here, for some reason
from pkg_resources import resource_stream, resource_exists
# pylint: enable-msg=E0611
from sqlobject import SQLObjectNotFound
from sutekh.core.SutekhObjectCache import SutekhObjectCache
    def _link_resource(self, sLocalUrl):
        """Return a file-like object which sLocalUrl can be read from."""
        sResource = '/docs/html/%s' % sLocalUrl
        if resource_exists('sutekh', sResource):
            return resource_stream('sutekh', sResource)
        else:
            raise ValueError("Unknown resource %s" % sLocalUrl)

src/s/u/sutekh-HEAD/releases/stable-tags/0.6.1/sutekh/gui/MultiPaneWindow.py   sutekh(Download)
import gtk
# pylint: disable-msg=E0611
# pylint doesn't see resource_stream here, for some reason
from pkg_resources import resource_stream, resource_exists
# pylint: enable-msg=E0611
from sqlobject import SQLObjectNotFound
from sutekh.core.SutekhObjectCache import SutekhObjectCache
    def _link_resource(self, sLocalUrl):
        """Return a file-like object which sLocalUrl can be read from."""
        sResource = '/docs/html/%s' % sLocalUrl
        if resource_exists('sutekh', sResource):
            return resource_stream('sutekh', sResource)
        else:
            raise ValueError("Unknown resource %s" % sLocalUrl)

src/s/u/sutekh-HEAD/releases/stable-tags/0.6.0rc2/sutekh/gui/MultiPaneWindow.py   sutekh(Download)
import gtk
# pylint: disable-msg=E0611
# pylint doesn't see resource_stream here, for some reason
from pkg_resources import resource_stream, resource_exists
# pylint: enable-msg=E0611
from sqlobject import SQLObjectNotFound
from sutekh.core.SutekhObjectCache import SutekhObjectCache
    def _link_resource(self, sLocalUrl):
        """Return a file-like object which sLocalUrl can be read from."""
        sResource = '/docs/html/%s' % sLocalUrl
        if resource_exists('sutekh', sResource):
            return resource_stream('sutekh', sResource)
        else:
            raise ValueError("Unknown resource %s" % sLocalUrl)

  1 | 2 | 3  Next