337 Commits

Author SHA1 Message Date
robotis
cb291c5e80 Fix for issue 31. hsl(a) processing on floats. 2014-02-18 12:00:07 +00:00
robotis
19ed65645d Merge pull request #35 from chevah/parse-from-stream
Parse content from a stream.
2014-02-18 10:38:23 +00:00
Adi Roiban
e82ca278c4 Update after review. 2014-02-18 11:24:00 +02:00
Adi Roiban
f11e9e6ece Fix py3. 2014-02-16 18:06:04 +02:00
Adi Roiban
31b6dffd93 Fix py3 string. 2014-02-16 18:03:31 +02:00
Adi Roiban
a329d2befd Update py3. 2014-02-16 17:57:29 +02:00
Adi Roiban
5a763750d4 Add support for py3. 2014-02-16 17:48:07 +02:00
Adi Roiban
032cfa1a8c Initial code for parsing from stream. 2014-02-16 15:54:00 +02:00
Sascha Peilicke
5b0ab9bb6a Merge pull request #34 from saschpe/master-coverage
Coverage reports and badges
2014-02-10 09:28:56 +01:00
Sascha Peilicke
2716b1d71c Add additional badges (coveralls, license, wheel support) 2014-02-06 17:51:40 +01:00
Sascha Peilicke
2abe3ed9e5 Produce code coverage results and publish to coveralls.io 2014-02-06 17:50:20 +01:00
Sascha Peilicke
7502871087 Add 'coverage' 2014-02-06 17:50:07 +01:00
Sascha Peilicke
206b37761d Update badges 2014-02-05 16:01:21 +01:00
Sascha Peilicke
21a6de337e Fix setup.py url 2014-02-05 15:56:17 +01:00
robotis
923f1b089a Minor path fix 2014-02-05 14:44:42 +00:00
Sascha Peilicke
7de7640465 Updated README.rst
Added some badges and pip installation instructions.
2014-02-02 19:23:16 +01:00
Sascha Peilicke
7f6c314c71 Bump version to 0.10.1 2014-02-02 18:55:23 +01:00
Sascha Peilicke
315baa2147 Whitespace after CSS filters is significant
Fixes issue 30
2014-02-02 18:54:58 +01:00
Sascha Peilicke
acdcc28bf9 Merge pull request #32 from saschpe/master-stuff
Master stuff
0.10
2014-02-02 09:34:01 -08:00
Sascha Peilicke
da1b0d2b9d Bump version to 0.10
Moved to lesscpy.__version__ and use it in setup.py. Also, don't put the
whole license text into the 'license' tag but rather the short form
'MIT'. The license file is part of the source distribution already and
was added to package_data (so that it ends up somewhere when 'setup.py
install' is invoked).
2014-02-02 18:30:28 +01:00
Sascha Peilicke
28c31a913f Drop '__main__' from tests
Direct test invocation doesn't work reliably across all environments.
Using 'nosetests $FILE' is much more efficient.
2014-02-02 18:30:28 +01:00
Sascha Peilicke
007ffcf2e7 Use nose
The sanest way to discover and run tests across py27, py33, py34, tox
and Travis-CI and 'setup.py test'.
2014-02-02 18:30:26 +01:00
Sascha Peilicke
f445e8d5f1 Add AUTHORS file
Generated from git changelog and removed doublets.
2014-02-02 18:30:13 +01:00
Sascha Peilicke
3f6ef58708 Move bin/ to scripts/ 2014-02-02 18:01:41 +01:00
Sascha Peilicke
047d30582d Support publishing wheels
Lesscpy is currently pure-Python and works with both py2 and p3, so we
can publish universal wheels.

See http://pythonwheels.com/
2014-02-02 18:01:40 +01:00
Sascha Peilicke
0e6faff0fb Drop 'pep8' tox target
We have flake8 which is a wrapper around pep8, pyflakes and mccabe.
2014-02-02 18:01:40 +01:00
Sascha Peilicke
4a7aaa6ce5 Refactor testsuite invocation
Move shared parts into test.core and use it in LESS, issues and
bootstrap3 auto-generated tests. This simplifies the test code and
allows to use nosetests (or any other test runner).
2014-02-02 18:01:40 +01:00
Sascha Peilicke
1097d95215 Name all tests consistently
Let all of them start with 'test_'. And move __main__.py into
__init__.py.
2014-02-02 17:35:38 +01:00
Sascha Peilicke
4d63ecfe25 Fix all PEP-8 / flake8 code issues
Drop testscope because it's empty.
2014-02-02 17:35:38 +01:00
Sascha Peilicke
3cd83f18fe Add test-requirements.txt
The central place for all testing requirements. And use it everywhere.
2014-02-02 17:35:38 +01:00
Sascha Peilicke
268d1d78e3 Enhance setup.py
Use trove classifiers instead of keywords. Use 'python' (not
'python3') in the she-bang line to let distributions decide. Use
pkg_resources to load install_requires from requirements.txt. This way
there's only one place to specify dependencies. Since this and
install_requires depend on setuptools, use find_packages rather than
explictly listing Python modules. Fix URL typo.
2014-02-02 14:19:43 +01:00
Sascha Peilicke
a556030931 Move tests to root dir
In essence, tests are not an importable submodule anymore but an
independent piece of code that won't be installed in a user's
site-packages directory.
2014-02-02 13:28:58 +01:00
Sascha Peilicke
abac6e9096 Merge pull request #28 from saschpe/master-bootstrap3
bootstrap3 and less>=1.4.0 support
2014-01-30 06:06:15 -08:00
Sascha Peilicke
ed91f7dac6 Adjust bootstrap3 test CSS to lesscpy
We still have subtle differences that are semantically equivalent:

  - #fff vs. #ffffff
  - 0.0 vs .0
  - 0 vs 0%
  - property sort order (and identation for -moz-$BLA)

There are still some other issues to fix, disable the bootstrap3 test
therefore to let the testsuite pass.
2014-01-24 14:05:18 +01:00
Sascha Peilicke
277d8c3957 Fix '&' multiplication
Let'S do it by example:

  .ident_a, .ident_b {
    & + & + & { color: red; }
  }

We have to generate all permutations of the parent identifier list and
the amount of ampersand child identifiers. In the above case, the
exploded identifier list has ident_count**ampersand_count entries (8).

As a bonus, we get the same identifier sort order as lessc does.

Conflicts:
	lesscpy/plib/identifier.py
2014-01-24 14:01:10 +01:00
Sascha Peilicke
54b1e696c6 Add missing whitespace for & 2014-01-24 13:58:11 +01:00
Sascha Peilicke
e70c16c570 Fix url("..") whitespace formatting regex.
Missed some cases.
2014-01-24 13:58:11 +01:00
Sascha Peilicke
68bbfc3161 Always break lines after commas in identifiers
Upstream lessc does it and we want to align.
2014-01-24 13:58:11 +01:00
Sascha Peilicke
6f4a3efd3c Support & nesting and (double-)nested media queries
Example:

  .visible {
    &.visible-sm {
      @media screen { color: blue; }
    }
  }

Not the most beautiful code on the planet but does the trick.
2014-01-23 14:10:17 +01:00
Sascha Peilicke
3b74578cc9 Implement nested media queries
Including double-nested queries which are used (not only) by bootstrap3.
Triple-nested (or more) media queries are currently not supported. Added
several tests.

See http://www.lesscss.org/#-nested-media-queries
2014-01-22 11:27:46 +01:00
Sascha Peilicke
bba63d9df5 Proper media queries
The lexer now identifies media queries in @media ... {} and
@import ... ; statements. For that, two new states "mediaquery" and
import" where added. The parser uses those to implement the CSS3 media
query BNF (www.w3.org/TR/css3-mediaqueries). Overall test coverage
increased.
2014-01-21 15:03:06 +01:00
Sascha Peilicke
1c2240dfd7 Accept resolution types as css_number
dpi, dpcm and dppx, check http://www.w3.org/TR/css3-values/#resolution
2014-01-21 15:03:06 +01:00
Sascha Peilicke
c0510a4d11 Skip empty @media blocks 2014-01-21 15:03:06 +01:00
Sascha Peilicke
74bee8c411 Output rgba(x,y,z,0) exactly as lessc
Currently a hack.
2014-01-21 15:03:06 +01:00
Sascha Peilicke
7a041ce2a9 Apply bootstrap3 theme CSS formatting
The previous test case was generated by lessc (upstream). Meanwhile,
lesscpy also parses it but generates slightly different (though
functionally equivalent) output. Therefore adjust the desired output so
that this test finally passes.
2014-01-21 15:03:06 +01:00
Sascha Peilicke
93bdaac50f Use greyscale rather than grayscale.
The latter doesn't exist (anymore).
2014-01-21 15:03:06 +01:00
Sascha Peilicke
27f10f25d3 Allow float degrees / percentages in color functions 2014-01-21 15:03:06 +01:00
Sascha Peilicke
6ecdef7f35 Support expressions in @media attributes 2014-01-21 15:03:05 +01:00
Sascha Peilicke
106c9972d4 Add argb() function
Used by bootstrap3. Quote from the lesscss.org documentation:

Creates a hex representation of a color in #AARRGGBB format (NOT
Android development.
2014-01-21 15:03:05 +01:00
Sascha Peilicke
b2e13d0470 Proper rgba() function alpha output
The alpha value can either be a number in the range 0-1 or a percentage
(0-100%). Alpha values greater than 1 are simply dropped. Compare with
the rgba() function definition at http://lesscss.org/#reference.
2013-12-20 11:15:42 +01:00