Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

command line depender needs to encode UTF-8 content first.

  • Loading branch information...
commit 9ba3f537d054b3081085ddf5187b8bfc7906bfbf 1 parent 147de1f
@andyao1 andyao1 authored committed
Showing with 12 additions and 5 deletions.
  1. +3 −0  README.md
  2. +9 −5 django/src/depender/cli.py
View
3  README.md
@@ -182,6 +182,9 @@ The Command Line Option
-----------------------
The depender can also generate concatenated JavaScript files on the command line:
+ $ git submodule update --init
+ $ virtualenv env
+ $ env/bin/python django/setup.py develop
$ env/bin/python django/src/depender/cli.py django/mootools/settings.py -R Core > mootools-core.js
$ env/bin/python django/src/depender/cli.py django/mootools/settings.py -R More -E Core > mootools-more.js
View
14 django/src/depender/cli.py
@@ -68,21 +68,25 @@ def get_arr(val):
deps = dpdr.get_transitive_dependencies(required, excluded)
files = dpdr.get_files(deps, excluded)
- output = "//No files included for build"
+ outputs = []
if len(files) > 0:
#TODO: add copyrights
- output = u""
+ output = ""
output += "\n//This library: %s" % (" ".join(sys.argv),)
output += "\n//Contents: "
output += ", ".join([ i.package.key + ":" + i.shortname for i in files ])
output += "\n\n"
+ outputs.append(output)
for f in files:
- output += "// Begin: " + f.shortname + "\n"
- output += f.content + u"\n\n"
+ outputs.append("// Begin: " + f.shortname + "\n")
+ outputs.append(f.content.encode('utf-8'))
+ outputs.append("\n\n")
+ else:
+ outputs.append("//No files included for build")
- print output
+ print "".join(outputs)
def main():
usage = "usage: %prog settings.py [options]"
Please sign in to comment.
Something went wrong with that request. Please try again.