本文整理汇总了Python中helpers.TempEnvironmentHelper类的典型用法代码示例。如果您正苦于以下问题:Python TempEnvironmentHelper类的具体用法?Python TempEnvironmentHelper怎么用?Python TempEnvironmentHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TempEnvironmentHelper类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
def setup(self):
try:
import closure
except ImportError:
raise SkipTest()
TempEnvironmentHelper.setup(self)
示例2: setup
def setup(self):
TempEnvironmentHelper.setup(self)
# Test the timestamp updater with cache disabled, so that the
# BundleDefUpdater() base class won't interfere.
self.env.cache = False
self.env.updater = self.updater = TimestampUpdater()
示例3: setup
def setup(self):
TempEnvironmentHelper.setup(self)
class MyCache(BaseCache):
def __init__(self):
self.enabled = False
self.reset()
def get(self, key):
self.getops += 1
if self.enabled:
return 'foo'
return False
def set(self, key, data):
self.setops += 1
def reset(self):
self.getops = 0
self.setops = 0
class CompleteFilter(Filter):
# Support all possible filter operations
def input(self, *a, **kw):
pass
output = open = concat = input
self.filter = CompleteFilter
self.env.cache = self.cache = MyCache()
self.env.manifest = None
# Note that updater will use the cache also
self.env.updater = TimestampUpdater()
示例4: setup
def setup(self):
TempEnvironmentHelper.setup(self)
class CustomUpdater(BaseUpdater):
allow = True
def needs_rebuild(self, *a, **kw):
return self.allow
self.m.updater = CustomUpdater()
示例5: setup
def setup(self):
TempEnvironmentHelper.setup(self)
self.app = Flask(__name__, static_path='/app_static')
import test_module
if not Blueprint:
self.module = Module(test_module.__name__, name='module',
static_path='/mod_static')
self.app.register_module(self.module)
else:
self.blueprint = Blueprint('module', test_module.__name__,
static_url_path='/mod_static',
static_folder='static')
self.app.register_blueprint(self.blueprint)
self.env = Environment(self.app)
示例6: setup
def setup(self):
TempEnvironmentHelper.setup(self)
class MyCache(BaseCache):
def __init__(self):
self.enabled = False
self.reset()
def get(self, key):
self.getops += 1
if self.enabled:
return 'foo'
return False
def set(self, key, data):
self.setops += 1
def reset(self):
self.getops = 0
self.setops = 0
self.m.cache = self.cache = MyCache()
# Note that updater will use the cache also
self.m.updater = 'timestamp'
示例7: setup
def setup(self):
if not find_executable("coffee"):
raise SkipTest()
TempEnvironmentHelper.setup(self)
示例8: setup
def setup(self):
if not find_executable('r.js'):
raise SkipTest('"r.js" executable not found')
TempEnvironmentHelper.setup(self)
self.env.config['requirejs_config'] = self.path('requirejs.json')
self.env.config['requirejs_baseUrl'] = self.path('')
示例9: setup
def setup(self):
try:
import closure_soy
except:
raise SkipTest()
TempEnvironmentHelper.setup(self)
示例10: setup
def setup(self):
TempEnvironmentHelper.setup(self)
self.env.updater = False
self.env.directory = self.path('dir')
self.env.debug = True