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

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

src/r/e/repoze.bfg-1.3a15/repoze/bfg/resource.py   repoze.bfg(Download)
    def get_filename(self, resource_name):
        for package, rname in self.search_path(resource_name):
            if pkg_resources.resource_exists(package, rname):
                return pkg_resources.resource_filename(package, rname)
 
    def get_stream(self, resource_name):
        for package, rname in self.search_path(resource_name):
            if pkg_resources.resource_exists(package, rname):
                return pkg_resources.resource_stream(package, rname)
 
    def get_string(self, resource_name):
        for package, rname in self.search_path(resource_name):
            if pkg_resources.resource_exists(package, rname):
    def has_resource(self, resource_name):
        for package, rname in self.search_path(resource_name):
            if pkg_resources.resource_exists(package, rname):
                return True
 
    def isdir(self, resource_name):
        for package, rname in self.search_path(resource_name):
            if pkg_resources.resource_exists(package, rname):
                return pkg_resources.resource_isdir(package, rname)
 
    def listdir(self, resource_name):
        for package, rname in self.search_path(resource_name):
            if pkg_resources.resource_exists(package, rname):

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/p/y/pymage-0.3.0patch1/pymage/vfs.py   pymage(Download)
    def exists(self, path):
        return pkg_resources.resource_exists(self.package, self._strpath(path))
 
    def isdir(self, path):
        return pkg_resources.resource_isdir(self.package, self._strpath(path))
 
    def isfile(self, path):
        path = self._strpath(path)
        return (pkg_resources.resource_exists(self.package, path) and

src/n/a/nagare-0.3.0/nagare/admin/serve.py   nagare(Download)
    """
    path = os.path.join('static', path[1:])
 
    if not pkg_resources.resource_exists(package, path) or pkg_resources.resource_isdir(package, path):
        return None
 
    return pkg_resources.resource_filename(package, path)

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/n/a/nagare-0.3.0/nagare/admin/serve_module.py   nagare(Download)
    """
    path = os.path.join('static', path[1:])
 
    if not pkg_resources.resource_exists(package, path) or pkg_resources.resource_isdir(package, path):
        return None
 
    return pkg_resources.resource_filename(package, path)

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/p/y/pyobjc-core-2.3/Lib/objc/_bridgesupport.py   pyobjc-core(Download)
        # Needed because the system bridgesupport files are buggy.
        try:
            exists = pkg_resources.resource_exists(
                    frameworkResourceName, "PyObjC.bridgesupport")
 
        except ImportError:
            pass
        # Check if we have additional metadata bundled with PyObjC
        try:
            exists = pkg_resources.resource_exists(
                frameworkResourceName, "PyObjCOverrides.bridgesupport")
 
        except ImportError:
            pass
            # Check if we have additional metadata bundled with PyObjC
            try:
                exists = pkg_resources.resource_exists(
                    frameworkResourceName, "PyObjCOverrides.bridgesupport")
 
            except ImportError:
                pass
 
    # And if that fails look for the metadata in the framework wrapper
    if pkg_resources.resource_exists(
            frameworkName, "PyObjC.bridgesupport"):
        data = pkg_resources.resource_string(frameworkResourceName,
            "PyObjC.bridgesupport")
        if data:

src/g/o/gocept.rdbmanagement-0.1.2/gocept/rdbmanagement/recipe.py   gocept.rdbmanagement(Download)
                self.install_generation_table()
                self.update_schema(0)
            else:
                assert pkg_resources.resource_exists(self.schema, 'init.sql'), (
                    'Initial generation script init.sql not found.')
                ret_code = self.call_psql(pkg_resources.resource_filename(
                        self.schema, 'init.sql'))
    def update_schema(self, current_generation):
        next_generation = current_generation + 1
        while pkg_resources.resource_exists(
            self.schema, 'update%s.sql' % next_generation):
            precondition_mod = 'precondition%s' % next_generation
            if pkg_resources.resource_exists(
                self.schema, precondition_mod+".py"):

src/r/e/repoze.bfg-1.3a15/repoze/bfg/static.py   repoze.bfg(Download)
            (not resource.startswith(self.root_resource)) ):
            # Out of bounds
            return self.not_found(environ, start_response)
        if not pkg_resources.resource_exists(self.package_name, resource):
            return self.not_found(environ, start_response)
        if pkg_resources.resource_isdir(self.package_name, resource):
            # @@: Cache?

  1 | 2 | 3 | 4 | 5  Next