Permalink
Browse files

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

  • Loading branch information...
1 parent 147de1f commit 9ba3f537d054b3081085ddf5187b8bfc7906bfbf @andyao1 andyao1 committed with Apr 27, 2011
Showing with 12 additions and 5 deletions.
  1. +3 −0 README.md
  2. +9 −5 django/src/depender/cli.py
View
@@ -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
@@ -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]"

0 comments on commit 9ba3f53

Please sign in to comment.