Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Auto build JS files using Pyinotify to help during development of JS in projects

Project description

jsautobuild documentation

This is meant to be used to help you write your own watching js builder
script. It provides the hooks and the pyinotify inclusion. You can tweak it to
your own specific application as required.

You need to build a simple script to use the builder. Below is an example
script that helps copy changed JS files to a build directory.


import os

from jsautobuild import YUIBuilder

def lp_path_builder(changed_path, **builder_props):
"""The custom bit of LP code that determines where files get moved to"""
# to start out let's assume your CWD is where we're referencing things from
CWD = os.getcwd()
JSDIR = os.path.join(CWD, builder_props['build_dir'])
RENAME = re.compile("^.*lib/lp/(.*)/javascript")

match =
js_dir = match.groups()[0]
return os.path.join(JSDIR, RENAME.sub(js_dir, changed_path))

if __name__ == "__main__":
build_dir = 'build/js/lp'
meta_name = 'LP_MODULES'
watch_dir = 'lib'

builder = YUIBuilder(lp_path_builder,

You need a function that will accept the filename of the JS file that has
changed, and then return back the proper location of that file in the build

What is the root directory all build files are heading to. This is also used
for the meta.js generate code. It'll build a list of all modules in this build

What is the Javascript global variable name you want the meta file to be
generated to. You'll use this in your own application to feed the module list
to the YUI combo loader.

**default True**
Should we rebuild the meta.js whenever a new .js file is created.

**default .**
This is the directory that is watched for all file changes and triggers the
build of js files. By default it'll watch the current working directory and
anything below that.

.. This is your project NEWS file which will contain the release notes.
.. Example:
.. The content of this file, along with README.rst, will appear in your
.. project's PyPI page.


*Release date: 28-Feb-2012

* Fix the requirements in


*Release date: 27-Feb-2012*

* Start the project to help build a JS auto building watcher.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jsautobuild, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size jsautobuild-0.2.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page