浏览代码

Merge branch 'hotfix'

version-14
Rushabh Mehta 8 年前
父节点
当前提交
b9275455c2
共有 3 个文件被更改,包括 25 次插入29 次删除
  1. +1
    -1
      frappe/__init__.py
  2. +20
    -22
      frappe/build.py
  3. +4
    -6
      frappe/commands/utils.py

+ 1
- 1
frappe/__init__.py 查看文件

@@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template

__version__ = '8.0.49'
__version__ = '8.0.50'
__title__ = "Frappe Framework"

local = Local()


+ 20
- 22
frappe/build.py 查看文件

@@ -23,42 +23,40 @@ def setup():
except ImportError: pass
app_paths = [os.path.dirname(pymodule.__file__) for pymodule in pymodules]

def bundle(no_compress, make_copy=False, verbose=False, beta=False):
def bundle(no_compress, make_copy=False, verbose=False):
"""concat / minify js files"""
# build js files
setup()

make_asset_dirs(make_copy=make_copy)

if beta:
command = 'node ../apps/frappe/frappe/build.js --build'
if not no_compress:
command += ' --minify'
subprocess.call(command.split(' '))
return
# new nodejs build system
command = 'node ../apps/frappe/frappe/build.js --build'
if not no_compress:
command += ' --minify'
subprocess.call(command.split(' '))

build(no_compress, verbose)
# build(no_compress, verbose)

def watch(no_compress, beta=False):
def watch(no_compress):
"""watch and rebuild if necessary"""

if beta:
command = 'node ../apps/frappe/frappe/build.js --watch'
subprocess.Popen(command.split(' '))
return
# new nodejs file watcher
command = 'node ../apps/frappe/frappe/build.js --watch'
subprocess.call(command.split(' '))

setup()
# setup()

import time
compile_less()
build(no_compress=True)
# import time
# compile_less()
# build(no_compress=True)

while True:
compile_less()
if files_dirty():
build(no_compress=True)
# while True:
# compile_less()
# if files_dirty():
# build(no_compress=True)

time.sleep(3)
# time.sleep(3)

def make_asset_dirs(make_copy=False):
assets_path = os.path.join(frappe.local.sites_path, "assets")


+ 4
- 6
frappe/commands/utils.py 查看文件

@@ -8,21 +8,19 @@ from frappe.commands import pass_context, get_site
@click.command('build')
@click.option('--make-copy', is_flag=True, default=False, help='Copy the files instead of symlinking')
@click.option('--verbose', is_flag=True, default=False, help='Verbose')
@click.option('--beta', is_flag=True, default=False, help='Use the new NodeJS build system')
def build(make_copy=False, verbose=False, beta=False):
def build(make_copy=False, verbose=False):
"Minify + concatenate JS and CSS files, build translations"
import frappe.build
import frappe
frappe.init('')
frappe.build.bundle(False, make_copy=make_copy, verbose=verbose, beta=beta)
frappe.build.bundle(False, make_copy=make_copy, verbose=verbose)

@click.command('watch')
@click.option('--beta', is_flag=True, default=False, help='Use the new NodeJS build system')
def watch(beta=False):
def watch():
"Watch and concatenate JS and CSS files as and when they change"
import frappe.build
frappe.init('')
frappe.build.watch(True, beta=beta)
frappe.build.watch(True)

@click.command('clear-cache')
@pass_context


正在加载...
取消
保存