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

All Samples(242)  |  Call(155)  |  Derive(0)  |  Import(87)
Return a readable file-like object for specified resource

src/p/y/pydataportability.examples-0.1dev-r42/pydataportability/examples/scripts/xrds.py   pydataportability.examples(Download)
from pydataportability.xrds.parser import XRDSParser
from pkg_resources import resource_stream
 
def main():
        # egg style retrieval of the file "xrds.xml"
        fp = resource_stream(__name__, 'xrds.xml')
        p = XRDSParser(fp)

src/r/e/repoze.bfg-1.3a15/repoze/bfg/resource.py   repoze.bfg(Download)
    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):

src/t/o/ToscaWidgets-0.9.10/tw/core/command.py   ToscaWidgets(Download)
                    require_once = None
                    if self.requireonce and ct == "application/javascript":
                        require_once = _JavascriptFileIter._marker_name(modname, name)
                    stream = pkg_resources.resource_stream(modname, name)
                    filename = '/'.join((modname, name))
                    self.execute(self.writer.write_file, (stream, filename),
                                 "Processing " + filename)

src/p/y/pymage-0.3.0patch1/pymage/vfs.py   pymage(Download)
    def open(self, path, mode='r', buffering=None):
        if mode not in ('r', 'rb'):
            raise ValueError("File must be opened in read, not %r" % mode)
        return pkg_resources.resource_stream(self.package, self._strpath(path))
 
    def listdir(self, path):
        path = self._abspath(path).convert(directory=True)

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/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)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next