Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
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
Exemple #4
0
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
Exemple #5
0
    def get_static_includer():
        bower = bowerstatic.Bower()
        components = bower.components(
            'myapp', bowerstatic.module_relative_path('bower_components'))

        return components
Exemple #6
0
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)
Exemple #7
0
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