コード例 #1
0
class CompilerTest(unittest.TestCase):
    def setUp(self):
        self.compiler = SASSCompiler()

        self.env = Environment(root=OUTPUT_DIR,
                               public_assets=(r'.*\.css', ),
                               fingerprinting=False)
        self.env.finders.register(FileSystemFinder([SCSS_DIR]))
        self.env.compilers.register('.scss', self.compiler.as_handler())
        self.env.register_defaults()
        self.env.save()

    def test_syntax(self):
        scss, css, output = fixture_load('syntax')
        self.assertEqual(css, output)

    def test_variables(self):
        scss, css, output = fixture_load('variables')
        self.assertEqual(css, output)

    def test_mixin(self):
        scss, css, output = fixture_load('mixin')
        self.assertEqual(css, output)

    def test_import(self):
        scss, css, output = fixture_load('import')
        self.assertEqual(css, output)

    def test_image(self):
        scss, css, output = fixture_load('image')
        self.assertEqual(css, output)
コード例 #2
0
class CompilerTest(unittest.TestCase):
    def setUp(self):
        self.compiler = SASSCompiler()

        self.env = Environment(root=OUTPUT_DIR, public_assets=(r".*\.css",), fingerprinting=False)
        self.env.finders.register(FileSystemFinder([SCSS_DIR]))
        self.env.compilers.register(".scss", self.compiler.as_handler())
        self.env.register_defaults()
        self.env.save()

    def test_syntax(self):
        scss, css, output = fixture_load("syntax")
        self.assertEqual(css, output)

    def test_variables(self):
        scss, css, output = fixture_load("variables")
        self.assertEqual(css, output)

    def test_mixin(self):
        scss, css, output = fixture_load("mixin")
        self.assertEqual(css, output)

    def test_import(self):
        scss, css, output = fixture_load("import")
        self.assertEqual(css, output)

    def test_image(self):
        scss, css, output = fixture_load("image")
        self.assertEqual(css, output)
コード例 #3
0
ファイル: __init__.py プロジェクト: RedBuld/Aviator

class RegexConverter(BaseConverter):
    def __init__(self, url_map, *items):
        super(RegexConverter, self).__init__(url_map)
        self.regex = items[0]


app.url_map.converters['regex'] = RegexConverter

gears = Gears(
    compilers={
        '.styl': StylusCompiler.as_handler(),
        '.less': LESSCompiler.as_handler(),
        '.coffee': CoffeeScriptCompiler.as_handler(),
        '.sass': SASSCompiler.as_handler(),
        '.scss': SASSCompiler.as_handler()
    },
    compressors={
        'text/css': CleanCSSCompressor.as_handler(),
        'text/javascript': UglifyJSCompressor.as_handler()
    },
)
gears.init_app(app)
db = SQLAlchemy(app)
login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'
# admin = Admin(app)
babel = Babel(app)
thumb = Thumbnail(app)
コード例 #4
0
ファイル: manage.py プロジェクト: RedBuld/-exp-W7_1pc
from gears_less import LESSCompiler
from gears_coffeescript import CoffeeScriptCompiler
from gears_sass import SASSCompiler
from gears_clean_css import CleanCSSCompressor
from gears_uglifyjs import UglifyJSCompressor

from app import app, db

migrate = Migrate(app, db)

gears = Gears(
    compilers={
        '.styl': StylusCompiler.as_handler(),
        '.less': LESSCompiler.as_handler(),
        '.coffee': CoffeeScriptCompiler.as_handler(),
        '.sass': SASSCompiler.as_handler(),
        '.scss': SASSCompiler.as_handler()
    },
    compressors={
        'text/css': CleanCSSCompressor.as_handler(),
        'text/javascript': UglifyJSCompressor.as_handler()
    },
)
gears.init_app(app)

manager = Manager(app)
manager.add_command('db', MigrateCommand)
manager.add_command('runserver', Server(host='0.0.0.0', port=80))

if __name__ == '__main__':
    manager.run()