Beispiel #1
0
def copydir(src, dst, minify=False):
    if not exists(dst):
        mkdir(dst)
    for itemname in listdir(src):
        src_path = join(src, itemname)
        if isfile(src_path):
            dst_path = join(dst, itemname)
            # if the files modify time is the same, do not copy
            if not exists(
                    dst_path) or getmtime(src_path) != getmtime(dst_path):
                if minify and not '.min.' in itemname and can_minify(src_path):
                    # minify
                    log('  Minifing ', itemname, color='yellow')
                    auto_minify(src_path, dst_path)
                    copystat(src_path, dst_path)
                else:
                    log('  Copying ', itemname)
                    # use 'copy2' to keep file metadate
                    copy2(src_path, dst_path)
        else:
            # isdir
            copydir(src_path, join(dst, itemname), minify)
Beispiel #2
0
 def test2():
     output.log("world")
Beispiel #3
0
 def test1():
     output.log("hello")
Beispiel #4
0
 def foo():
     log('foo')
Beispiel #5
0
 def world():
     log('world')
Beispiel #6
0
 def hello():
     log('hello')
Beispiel #7
0
def run():
    log('*** Generator Start ***', color='cyan')

    log('- Copying static files...', color='cyan')
    copy_static()
    log('- Copying completed', color='cyan')

    log('- Generating Structure tree...', color='cyan')
    generate_and_save()
    log('- Generating completed', color='cyan')

    log('- Rendering template file...', color='cyan')
    render_index()
    log('- Rendering completed', color='cyan')

    log('*** Task Completed ***', color='cyan')
Beispiel #8
0
 def foo():
     log( 'foo')
Beispiel #9
0
 def world():
     log( 'world')
Beispiel #10
0
 def hello():
     log( 'hello')