def test_relative_path_local_components(): bower = bowerstatic.Bower() components = bower.components( 'components', bowerstatic.module_relative_path('bower_components')) local = bower.local_components('local', components) local_component = local.component( bowerstatic.module_relative_path('local_component'), None) assert os.path.join(os.path.dirname(__file__), 'local_component') == local_component.path
def test_relative_path_local_components(): bower = bowerstatic.Bower() components = bower.components( 'components', bowerstatic.module_relative_path('bower_components')) local = bower.local_components('local', components) local_component = local.component( bowerstatic.module_relative_path('local_component'), None) assert os.path.join( os.path.dirname(__file__), 'local_component') == local_component.path
def test_relative_path_bower_components(): bower = bowerstatic.Bower() components = bower.components( 'components', bowerstatic.module_relative_path('bower_components')) assert os.path.join(os.path.dirname(__file__), 'bower_components') == components.path
def test_relative_path_bower_components(): bower = bowerstatic.Bower() components = bower.components( 'components', bowerstatic.module_relative_path('bower_components')) assert os.path.join( os.path.dirname(__file__), 'bower_components') == components.path
def get_static_includer(): bower = bowerstatic.Bower() components = bower.components( 'myapp', bowerstatic.module_relative_path('bower_components')) return components
import bowerstatic from .model import Base Session = scoped_session(sessionmaker()) register(Session) class App(StaticApp, TransactionApp): pass bower = bowerstatic.Bower() components = bower.components( 'components', bowerstatic.module_relative_path('bower_components')) local = bower.local_components('local', components) local.component(bowerstatic.module_relative_path('static'), version=None) local.component(bowerstatic.module_relative_path('skeleton'), version=None) @App.static_components() def get_static_components(): return local def main(): engine = sqlalchemy.create_engine('sqlite:///morepath_sqlalchemy.db') Session.configure(bind=engine)
import waitress import bowerstatic from .model import Base Session = scoped_session(sessionmaker()) register(Session) class App(StaticApp, TransactionApp): pass bower = bowerstatic.Bower() components = bower.components( 'components', bowerstatic.module_relative_path('bower_components')) local = bower.local_components('local', components) local.component(bowerstatic.module_relative_path('static'), version=None) local.component(bowerstatic.module_relative_path('skeleton'), version=None) @App.static_components() def get_static_components(): return local def main(): engine = sqlalchemy.create_engine('sqlite:///morepath_sqlalchemy.db') Session.configure(bind=engine) Base.metadata.create_all(engine) Base.metadata.bind = engine