Exemplo n.º 1
0
def server(port=5500, output=OUTPUT, content=CONTENT, extensions=EXTENSIONS):
    shell('make clean')
    shell('make html')

    output.chdir()
    server = Server()

    cmd = 'pelican -s {} -o {}'.format(ROOT.child('pelicanconf.py'), output)

    for ext in extensions:
        print(content.child(ext))
        server.watch(content.child(ext), cmd)

    print(ROOT.child('themes'))
    server.watch(ROOT.child('themes'), cmd)

    server.watch(output.child('*.html'))
    server.watch(output.child('*.css'))

    server.serve(liveport=35729, port=port)
Exemplo n.º 2
0
def publish(dry_run):
    BUCKET = 's3://curtocircuito.cc'

    def run(args):
        click.echo(' '.join(args))
        call(args, stdout=sys.stdout, stderr=sys.stdout)

    dry_option = '--dry-run' if dry_run else ''

    run(['pelican', '-s', ROOT.child('publishconf.py'), '-o', OUTPUT])
    run(['s3cmd', 'sync', dry_option, OUTPUT.child('episodes'), BUCKET, '--acl-public', '--guess-mime-type', '--config=.s3cfg'])
    run(['s3cmd', 'sync', dry_option, OUTPUT + '/', BUCKET, '--acl-public', '--delete-removed', '--guess-mime-type', '--config=.s3cfg'])