Permalink
Browse files

Initial commit

  • Loading branch information...
yumike committed Jun 25, 2012
0 parents commit 53d860ada925bc5cc589524f6f453c1eeb4e5a43
Showing with 5,648 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +13 −0 LICENSE
  3. +5 −0 MANIFEST.in
  4. +4 −0 Makefile
  5. +37 −0 README.rst
  6. +1 −0 gears_less/__init__.py
  7. +20 −0 gears_less/compiler.js
  8. +9 −0 gears_less/compiler.py
  9. +2 −0 gears_less/node_modules/less/.gitignore
  10. +26 −0 gears_less/node_modules/less/CHANGELOG
  11. +179 −0 gears_less/node_modules/less/LICENSE
  12. +75 −0 gears_less/node_modules/less/Makefile
  13. +20 −0 gears_less/node_modules/less/README.md
  14. +47 −0 gears_less/node_modules/less/benchmark/less-benchmark.js
  15. +139 −0 gears_less/node_modules/less/bin/lessc
  16. +10 −0 gears_less/node_modules/less/index.html
  17. +380 −0 gears_less/node_modules/less/lib/less/browser.js
  18. +151 −0 gears_less/node_modules/less/lib/less/colors.js
  19. +355 −0 gears_less/node_modules/less/lib/less/cssmin.js
  20. +228 −0 gears_less/node_modules/less/lib/less/functions.js
  21. +148 −0 gears_less/node_modules/less/lib/less/index.js
  22. +1,305 −0 gears_less/node_modules/less/lib/less/parser.js
  23. +62 −0 gears_less/node_modules/less/lib/less/rhino.js
  24. +17 −0 gears_less/node_modules/less/lib/less/tree.js
  25. +17 −0 gears_less/node_modules/less/lib/less/tree/alpha.js
  26. +13 −0 gears_less/node_modules/less/lib/less/tree/anonymous.js
  27. +17 −0 gears_less/node_modules/less/lib/less/tree/assignment.js
  28. +48 −0 gears_less/node_modules/less/lib/less/tree/call.js
  29. +101 −0 gears_less/node_modules/less/lib/less/tree/color.js
  30. +14 −0 gears_less/node_modules/less/lib/less/tree/comment.js
  31. +42 −0 gears_less/node_modules/less/lib/less/tree/condition.js
  32. +49 −0 gears_less/node_modules/less/lib/less/tree/dimension.js
  33. +35 −0 gears_less/node_modules/less/lib/less/tree/directive.js
  34. +47 −0 gears_less/node_modules/less/lib/less/tree/element.js
  35. +23 −0 gears_less/node_modules/less/lib/less/tree/expression.js
  36. +79 −0 gears_less/node_modules/less/lib/less/tree/import.js
  37. +51 −0 gears_less/node_modules/less/lib/less/tree/javascript.js
  38. +19 −0 gears_less/node_modules/less/lib/less/tree/keyword.js
  39. +114 −0 gears_less/node_modules/less/lib/less/tree/media.js
  40. +135 −0 gears_less/node_modules/less/lib/less/tree/mixin.js
  41. +32 −0 gears_less/node_modules/less/lib/less/tree/operation.js
  42. +16 −0 gears_less/node_modules/less/lib/less/tree/paren.js
  43. +29 −0 gears_less/node_modules/less/lib/less/tree/quoted.js
  44. +42 −0 gears_less/node_modules/less/lib/less/tree/rule.js
  45. +216 −0 gears_less/node_modules/less/lib/less/tree/ruleset.js
  46. +42 −0 gears_less/node_modules/less/lib/less/tree/selector.js
  47. +25 −0 gears_less/node_modules/less/lib/less/tree/url.js
  48. +24 −0 gears_less/node_modules/less/lib/less/tree/value.js
  49. +26 −0 gears_less/node_modules/less/lib/less/tree/variable.js
  50. +13 −0 gears_less/node_modules/less/package.json
  51. +58 −0 gears_less/node_modules/less/test/css/colors.css
  52. +56 −0 gears_less/node_modules/less/test/css/comments.css
  53. +58 −0 gears_less/node_modules/less/test/css/css-3.css
  54. +20 −0 gears_less/node_modules/less/test/css/css-escapes.css
  55. +89 −0 gears_less/node_modules/less/test/css/css.css
  56. +43 −0 gears_less/node_modules/less/test/css/functions.css
  57. +5 −0 gears_less/node_modules/less/test/css/ie-filters.css
  58. +23 −0 gears_less/node_modules/less/test/css/import.css
  59. +22 −0 gears_less/node_modules/less/test/css/javascript.css
  60. +3 −0 gears_less/node_modules/less/test/css/lazy-eval.css
  61. +79 −0 gears_less/node_modules/less/test/css/media.css
  62. +76 −0 gears_less/node_modules/less/test/css/mixins-args.css
  63. +9 −0 gears_less/node_modules/less/test/css/mixins-closure.css
  64. +58 −0 gears_less/node_modules/less/test/css/mixins-guards.css
  65. +17 −0 gears_less/node_modules/less/test/css/mixins-important.css
  66. +14 −0 gears_less/node_modules/less/test/css/mixins-nested.css
  67. +47 −0 gears_less/node_modules/less/test/css/mixins-pattern.css
  68. +71 −0 gears_less/node_modules/less/test/css/mixins.css
  69. +49 −0 gears_less/node_modules/less/test/css/operations.css
  70. +20 −0 gears_less/node_modules/less/test/css/parens.css
  71. +33 −0 gears_less/node_modules/less/test/css/rulesets.css
  72. +15 −0 gears_less/node_modules/less/test/css/scope.css
  73. +69 −0 gears_less/node_modules/less/test/css/selectors.css
  74. +40 −0 gears_less/node_modules/less/test/css/strings.css
  75. +27 −0 gears_less/node_modules/less/test/css/variables.css
  76. +38 −0 gears_less/node_modules/less/test/css/whitespace.css
  77. +73 −0 gears_less/node_modules/less/test/less-test.js
  78. +1 −0 gears_less/node_modules/less/test/less/import/import-test-d.css
  79. +30 −0 setup.py
@@ -0,0 +1,3 @@
+*.egg-info
+*.pyc
+dist
13 LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2012, Mike Yumatov <mike@yumatov.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,5 @@
+include LICENSE
+include README.rst
+
+include gears_less/compiler.js
+recursive-include gears_less/node_modules *
@@ -0,0 +1,4 @@
+update:
+ rm -rf gears_less/node_modules
+ cd gears_less && npm install less
+ rm -rf gears_less/node_modules/.bin
@@ -0,0 +1,37 @@
+gears-less
+==================
+
+LESS_ compiler for Gears_. This package already includes the LESS source
+code for you, so you don't need to worry about installing it yourself.
+
+Installation
+------------
+
+Install ``gears-less`` with pip::
+
+ $ pip install gears-less
+
+
+Requirements
+------------
+
+``gears-less`` requires node.js_ to be installed in your system.
+
+
+Usage
+-----
+
+Add ``gears_less.LESSCompiler`` to ``environment``'s compilers registry::
+
+ from gears_less import LESSCompiler
+ environment.compilers.register('.less', LESSCompiler.as_handler())
+
+If you use Gears in your Django project, add this code to its settings::
+
+ GEARS_COMPILERS = {
+ '.less': 'gears_less.LESSCompiler',
+ }
+
+.. _LESS: http://lesscss.org/
+.. _Gears: https://github.com/gears/gears
+.. _node.js: http://nodejs.org/
@@ -0,0 +1 @@
+from .compiler import LESSCompiler
@@ -0,0 +1,20 @@
+var less = require('less'),
+ source = '';
+
+process.stdin.resume();
+process.stdin.setEncoding('utf8');
+
+process.stdin.on('data', function(chunk) {
+ source += chunk;
+});
+
+process.stdin.on('end', function() {
+ var parser = new less.Parser();
+ parser.parse(source, function(err, tree) {
+ if (err) {
+ less.writeError(err);
+ process.exit(1);
+ }
+ process.stdout.write(tree.toCSS());
+ });
+});
@@ -0,0 +1,9 @@
+import os
+from gears.compilers import ExecCompiler
+
+
+class LESSCompiler(ExecCompiler):
+
+ result_mimetype = 'text/css'
+ executable = 'node'
+ params = [os.path.join(os.path.dirname(__file__), 'compiler.js')]

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 53d860a

Please sign in to comment.