All Samples(1013) | Call(713) | Derive(0) | Import(300)
Return a true filesystem path for specified resource
src/m/o/modu-HEAD/examples/modusite/modu/sites/modusite_site.py modu(Download)
def configure_request(self, req):
req['trac.env_path'] = pkg.resource_filename('modusite', 'trac')
def initialize(self, application):
application.base_domain = self.hostname
application.db_url = db_url
application.session_cookie_params = {'Path':'/'}
application.template_dir = 'modusite', 'template'
application.release_path = self.release_path
application.md5_path = self.md5_path
application.activate('/assets', static.FileResource, pkg.resource_filename('modu.assets', ''))
if not(os.path.exists(application.compiled_template_root)):
os.makedirs(application.compiled_template_root)
trac_htdocs_path = pkg.resource_filename('trac', 'htdocs')
application.activate('/trac/chrome/common', static.FileResource, trac_htdocs_path)
site_htdocs_path = pkg.resource_filename('modusite', 'trac/htdocs')
src/m/o/modu-1.0.2/examples/modusite/modu/sites/modusite_site.py modu(Download)
def configure_request(self, req):
req['trac.env_path'] = pkg.resource_filename('modusite', 'trac')
def initialize(self, application):
application.base_domain = self.hostname
application.db_url = db_url
application.session_cookie_params = {'Path':'/'}
application.template_dir = 'modusite', 'template'
application.release_path = self.release_path
application.md5_path = self.md5_path
application.activate('/assets', static.FileResource, pkg.resource_filename('modu.assets', ''))
if not(os.path.exists(application.compiled_template_root)):
os.makedirs(application.compiled_template_root)
trac_htdocs_path = pkg.resource_filename('trac', 'htdocs')
application.activate('/trac/chrome/common', static.FileResource, trac_htdocs_path)
site_htdocs_path = pkg.resource_filename('modusite', 'trac/htdocs')
src/e/v/evserver-HEAD/evserver/examples/django_chat/urls.py evserver(Download)
from django.conf.urls.defaults import * from pkg_resources import resource_filename import os.path import django.views.static import django.views.generic.simple module_dir = resource_filename(__name__, '.')
src/e/v/evserver-HEAD/evserver/examples/django_chat/settings.py evserver(Download)
ROOT_URLCONF = 'django_chat.urls'
from pkg_resources import resource_filename
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
resource_filename(__name__, '.'),
src/e/v/evserver-HEAD/evserver/examples/comet.py evserver(Download)
import mimetypes import random import uuid from pkg_resources import resource_filename import os, os.path, logging
def GET(self, filename='index.html'):
path = resource_filename(__name__, os.path.join('static',filename))
#path = os.path.join('static',filename)
if not os.access(path, os.R_OK):
web.notfound()
return
if filename=='index.html':
src/n/o/notmm-0.4.1/examples/local_settings.py notmm(Download)
from pkg_resources import resource_filename
from helloworld.config.settings import *
MEDIA_ROOT = resource_filename('helloworld', 'static')
DEBUG = True
USE_I18N = True
# For backward-compatibility with Django
TEMPLATE_DIRS = (
(resource_filename('helloworld', 'templates')),
)
#DATABASE_ENGINE = 'sqlite3'
src/m/o/modu-HEAD/examples/sandbox/modu/sites/sandbox_site.py modu(Download)
os.makedirs(application.compiled_template_root)
application.db_url = 'MySQLdb://sandbox:sandbox@localhost/sandbox'
application.activate('/assets', static.FileResource, pkg.resource_filename('modu.assets', ''))
application.activate('/admin', resource.AdminResource, default_listing='page')
application.activate('/fck', fck.FCKEditorResource)
src/m/o/modu-1.0.2/examples/sandbox/modu/sites/sandbox_site.py modu(Download)
os.makedirs(application.compiled_template_root)
application.db_url = 'MySQLdb://sandbox:sandbox@localhost/sandbox'
application.activate('/assets', static.FileResource, pkg.resource_filename('modu.assets', ''))
application.activate('/admin', resource.AdminResource, default_listing='page')
application.activate('/fck', fck.FCKEditorResource)
src/t/r/TracShellExampleMacro-1.0/shellexample/macro.py TracShellExampleMacro(Download)
from trac.web.chrome import ITemplateProvider, add_stylesheet
from genshi.core import Markup, escape
from genshi.builder import tag
from pkg_resources import resource_filename
class ShellExampleMacro(WikiMacroBase):
"""Preprocessor Highlight ShellExample"""
def get_htdocs_dirs(self):
yield 'shellexample', resource_filename(__name__, 'htdocs')
def get_templates_dirs(self):
return ()src/r/e/restish-0.11/examples/repoze.who/example/lib/templating.py restish(Download)
from restish.contrib.tempitarenderer import TempitaRenderer, TempitaFileSystemLoader
return TempitaRenderer(
TempitaFileSystemLoader(
pkg_resources.resource_filename('example', 'template')
)
)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next