diff options
author | Dafydd Harries <daf@rhydd.org> | 2013-03-18 04:02:06 -0400 |
---|---|---|
committer | Dafydd Harries <daf@rhydd.org> | 2013-03-18 04:02:06 -0400 |
commit | a3fe2c9b95b4abf657e078d9fa04fc5f339cce5c (patch) | |
tree | a4402c2c7e9646250e00e1e64e5ac9f80e18c14e | |
parent | 3fb386c2a3209a895e2922a458ee7864356b2cc6 (diff) |
use and/or instead of &/|
-rw-r--r-- | license.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -42,10 +42,10 @@ class Licenses(object): return '<%s %r>' % (self.__class__.__name__, self.xs) class AllLicenses(Licenses): - _join = '&' + _join = 'and' class AnyLicense(Licenses): - _join = '|' + _join = 'or' def parse_licenses(s): """ @@ -63,7 +63,7 @@ def parse_licenses(s): >>> ls <AnyLicense [<License X>, <License Y>, <License Z>]> >>> print ls - X | Y | Z + X or Y or Z >>> list(ls) [<License X>, <License Y>, <License Z>] >>> list(ls.flatten()) @@ -73,20 +73,20 @@ def parse_licenses(s): >>> ls <AllLicenses [<License X>, <License Y>, <License Z>]> >>> print ls - X & Y & Z + X and Y and Z >>> list(ls) [<License X>, <License Y>, <License Z>] >>> list(ls.flatten()) ['X', 'Y', 'Z'] >>> print parse_licenses("X or Y and Z") - X | (Y & Z) + X or (Y and Z) >>> print parse_licenses("X and Y or Z") - (X & Y) | Z + (X and Y) or Z >>> print parse_licenses("X, and Y or Z") - X & (Y | Z) + X and (Y or Z) """ splits = ( |