Skip to content

Commit

Permalink
Merge pull request #18 from GunioRobot/clean
Browse files Browse the repository at this point in the history
Hi! I cleaned up your code for you!
  • Loading branch information
whitmo committed Dec 19, 2011
2 parents 98fb2d6 + 244dedc commit 464fcbd
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 59 deletions.
18 changes: 9 additions & 9 deletions README.rst
Expand Up @@ -128,7 +128,7 @@ A section is formatted in the following fashion::

license=path/to/license/for/these/libs

first=
first=
3rd/prototype.js
core/application.js
core/params.js
Expand All @@ -152,7 +152,7 @@ The configuration allows for the interpolation of variables defined in
the config file. '%(resource-dir)s' may be subsituted for the value
of the -r flag.

Lines commented using '#' will be ignored.
Lines commented using '#' will be ignored.

If an `include` section is defined, jsbuild will only build listed
files from this section and theirs dependencies, else all files from
Expand All @@ -163,10 +163,10 @@ Dependency Syntax
~~~~~~~~~~~~~~~~~

File merging uses cues inside the candidate javascript files to
determine dependencies. Two types of dependencies are specified
determine dependencies. Two types of dependencies are specified
with two different comment formats within source files.

To specify that a target files must be included before a given
To specify that a target files must be included before a given
source file, include a comment of the following format:

// @requires <file path>
Expand All @@ -176,7 +176,7 @@ source file, include a comment of the following format:
// @requires Geo/DataSource.js

To specify that a target file must be included at any place
in the merged build - before or after a given source file -
in the merged build - before or after a given source file -
include a comment in the source file of the following format:

// @include <file path>
Expand All @@ -185,7 +185,7 @@ include a comment in the source file of the following format:

// @include Geo/DataSource.js

Note that the "exclude" list in a configuration file will
Note that the "exclude" list in a configuration file will
override dependencies specified by the @requires and @include
comment directives described above.

Expand Down Expand Up @@ -224,16 +224,16 @@ Run Tests
=========

in the src dir in an environment w/ yuicomp installed::

$ easy_install nose
$ paver get_yuicomp
$ cd test
$ cd test
$ nosetests {options}

or most simply::

$ python setup.py test


Credits
=======
Expand Down
2 changes: 1 addition & 1 deletion data/basic.cfg
@@ -1,7 +1,7 @@
[Output.js]
root=path/to/where/files/are
license=path/to/license/for/these/libs
first=
first=
3rd/prototype.js
core/application.js
core/params.js
Expand Down
3 changes: 1 addition & 2 deletions data/compress.cfg
@@ -1,5 +1,4 @@
[Output.js]
root=path/to/where/files/are
license=path/to/license/for/these/libs
first=compress.js

first=compress.js
2 changes: 1 addition & 1 deletion data/deps1.cfg
Expand Up @@ -17,4 +17,4 @@ include=core_param
require=
prototype
include=
core_api
core_api
2 changes: 1 addition & 1 deletion data/deps2-mismatch.cfg
Expand Up @@ -17,4 +17,4 @@ include=core_param
require=
prototype
include=
core_api
core_api
2 changes: 1 addition & 1 deletion data/exclude.cfg
@@ -1,7 +1,7 @@
[Output.js]
root=path/to/where/files/are
license=path/to/license/for/these/libs
first=
first=
core/application.js
core/params.js

Expand Down
8 changes: 4 additions & 4 deletions data/meta-concatenate.cfg
@@ -1,19 +1,19 @@
[Output1.js]
root=path/to/where/files/are
license=path/to/license/for/these/libs
include=
core1/lib1.js
include=
core1/lib1.js

[Output2.js]
root=path/to/where/files/are
license=path/to/license/for/these/libs
include=
include=
core2/lib2.js

[Output3.js]
root=path/to/where/files/are
license=path/to/license/for/these/libs
include=
include=
core3/lib3.js


Expand Down
4 changes: 2 additions & 2 deletions docs/TODO.txt
Expand Up @@ -20,7 +20,7 @@ Priority

* optional printout of logging for verbose flag



Blue Sky
========
Expand All @@ -30,5 +30,5 @@ Blue Sky
* server with file watching, automatic compression on serve

* svn/git checkout and build


16 changes: 8 additions & 8 deletions install_jstools
Expand Up @@ -24,7 +24,7 @@ try:
set
except NameError:
from sets import Set as set

join = os.path.join
py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1])
is_jython = sys.platform.startswith('java')
Expand Down Expand Up @@ -516,7 +516,7 @@ def create_environment(home_dir, site_packages=True, clear=False,
if sys.executable.startswith(bin_dir):
print 'Please use the *system* python to run this script'
return

if clear:
rmtree(lib_dir)
## FIXME: why not delete it?
Expand Down Expand Up @@ -575,7 +575,7 @@ def create_environment(home_dir, site_packages=True, clear=False,
exec_dir = join(sys.exec_prefix, 'lib', py_version)
for fn in os.listdir(exec_dir):
copyfile(join(exec_dir, fn), join(lib_dir, fn))

if is_jython:
# Jython has either jython.jar and javalib/ dir, or just
# jython-complete.jar
Expand Down Expand Up @@ -621,11 +621,11 @@ def create_environment(home_dir, site_packages=True, clear=False,
logger.notify('Also creating executable in %s' % secondary_exe)
shutil.copyfile(sys.executable, secondary_exe)
make_exe(secondary_exe)

if 'Python.framework' in prefix:
logger.debug('MacOSX Python framework detected')

# Copy the framework's dylib into the virtual
# Copy the framework's dylib into the virtual
# environment
virtual_lib = os.path.join(home_dir, '.Python')

Expand Down Expand Up @@ -720,7 +720,7 @@ def fix_lib64(lib_dir):
instead of lib/pythonX.Y. If this is such a platform we'll just create a
symlink so lib64 points to lib
"""
if [p for p in distutils.sysconfig.get_config_vars().values()
if [p for p in distutils.sysconfig.get_config_vars().values()
if isinstance(p, basestring) and 'lib64' in p]:
logger.debug('This system uses lib64; symlinking lib64 to lib')
assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], (
Expand Down Expand Up @@ -750,7 +750,7 @@ def resolve_interpreter(exe):

def make_environment_relocatable(home_dir):
"""
Makes the already-existing environment use relative paths, and takes out
Makes the already-existing environment use relative paths, and takes out
the #!-based environment selection in scripts.
"""
activate_this = os.path.join(home_dir, 'bin', 'activate_this.py')
Expand Down Expand Up @@ -889,7 +889,7 @@ def make_relative_path(source, dest, dest_is_directory=True):
# Special case for the current directory (otherwise it'd be '')
return './'
return os.path.sep.join(full_parts)



############################################################
Expand Down
6 changes: 3 additions & 3 deletions jstools/bo.txt
Expand Up @@ -14,7 +14,7 @@ Buildout Format
Variables
---------

* output-dir -- path to where final
* output-dir -- path to where final
should be written.

* compress -- True or False, minify output files
Expand All @@ -35,7 +35,7 @@ Basic example::
[build-js]
recipe=JSTools:buildjs
resource-dir=${buildout:develop-dir}/${client:folder-name}
config=${build-js:resource-dir}/all.cfg
config=${build-js:resource-dir}/all.cfg
output-dir=${build-js:resource-dir}/script
compress=True
...
Expand All @@ -47,7 +47,7 @@ jsbuild config file to build, 'output' defines the file created.
[build-js]
recipe=JSTools:buildjs
resource-dir=${buildout:develop-dir}/${client:folder-name}
config=${build-js:resource-dir}/all.cfg
config=${build-js:resource-dir}/all.cfg
output-dir=${build-js:resource-dir}/script
only=OpenLayers.js
output=${build-js:output-dir}/OL-uncompressed.js
Expand Down
Binary file modified setuptools-0.6c9-py2.4.egg
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/README.txt
Expand Up @@ -23,7 +23,7 @@ Coverage

could be improved::

* jstools.jsmin
* jstools.jsmin

* jstools.deps

Expand Down
2 changes: 1 addition & 1 deletion tests/basic-merge.txt
Expand Up @@ -30,7 +30,7 @@ Set the root directory and license::
>>> merger.set('Output.js', 'license', license_path)

Do merge::

>>> out = merger.run(uncompressed=True, single='Output.js')

Now let's test the output::
Expand Down
48 changes: 24 additions & 24 deletions tests/jst.txt
Expand Up @@ -10,7 +10,7 @@ Consider some code with well formatted comment blocks::
... /**
... * This is a plain old comment block.
... */
...
...
... /** api: foo
... * This comment block has the foo label.
... * There are multiple lines. Indentation may not decrease
Expand All @@ -20,24 +20,24 @@ Consider some code with well formatted comment blocks::
... /** api: bar[]
... * Create a list with brackets following the label.
... */
...
...
... /** api: bar[]
... * Keep adding items to a list.
... */
...
... */
...
... /** api: chicken[soup]
... * Names in brackets for a dictionary.
... */
...
...
... /** api: chicken[pie]
... * This content will be the value of the 'pie' key in the 'chicken'
... * dictionary.
... */
...
...
... /** api: chicken[rat]
... * These values will be inherited by data that extends this.
... */
...
...
... /** api: (define)
... * convenient = way
... * to = assign
Expand Down Expand Up @@ -88,15 +88,15 @@ Make sure that different comment formats don't mess things up::

>>> obj = jst.SourceFile("""
... /** regular old comment */
...
...
... /** api: foo
... * foo content
... */
...
...
... some_code; /* comment */
...
... /** api: one_liner = the one liner value */
...
...
... /** api: one_liner = the one liner value */
...
... /** api: bar
... * bar content
... */
Expand All @@ -123,24 +123,24 @@ Create some dummy source file objects and check their data dictionaries::

>>> from pprint import pprint
>>> parent = jst.SourceFile("""
...
...
... /** api: prop1 = parent prop1 value */
...
...
... /** api: prop2 = parent prop2 value */
...
...
... /** api: d[key1] = parent d['key1'] value */
...
...
... /** api: d[key2] = parent d['key2'] value */
...
... """)
...
... """)
>>> child = jst.SourceFile("""
...
...
... /** api: prop2 = child prop2 value */
...
...
... /** api: d[key2] = child d['key2'] value */
...
...
... /** api: d[key3] = child d['key3'] value */
...
...
... """)
>>> pprint(parent.data)
{'d': {'key1': "parent d['key1'] value", 'key2': "parent d['key2'] value"},
Expand All @@ -149,7 +149,7 @@ Create some dummy source file objects and check their data dictionaries::
>>> pprint(child.data)
{'d': {'key2': "child d['key2'] value", 'key3': "child d['key3'] value"},
'prop2': 'child prop2 value'}

Now, extend the child with data from the parent::

>>> child.inherit([parent])
Expand Down Expand Up @@ -179,7 +179,7 @@ By default, the parser looks for comments marked with api::
>>> obj = jst.SourceFile("/** custom: foo = bar */")
>>> len(obj.comments)
0

You can choose a custom marker by setting the 'marker' value in the options
dict::

Expand Down
2 changes: 1 addition & 1 deletion tests/tsort.txt
Expand Up @@ -17,7 +17,7 @@ Sort an example with a circular dependency (order forced):
>>> dependencies = dict(money=["opportunity", "education"], education=["money"], opportunity=["luck"], luck=[])
>>> sort(dependencies)
('luck', 'opportunity', 'education', 'money')

Sort an example with a missing dependency (MissingDependency raised):

>>> dependencies = dict(vegas=["gambling"], gambling=["luck"])
Expand Down

0 comments on commit 464fcbd

Please sign in to comment.