Jonathan Eunice  committed e7149b6

Tweaks for PEP8 conformance, version number bump to escape Python installer gotchas.

  • Participants
  • Parent commits 79214f5

Comments (0)

Files changed (5)

+  * Cleaned up source for better PEP8 conformance
+  * Bumped version number to 1.0 as part of move to `semantic 
+    versioning <>`_, or at least enough of it so
+    as to not screw up Python installation procedures (which don't
+    seem to understand 0.401 is a lesser version that 0.5, because
+    401 > 5).
+include README.rst
+include CHANGES.rst
+include pytest.ini
+include tox.ini
+recursive-include simplere *.py
+recursive-include test *.py
-Python regular expressions are powerful, but the language's lack of an *en passant*
+Python regular expressions are powerful, but the language's
+lack of an *en passant*
 (in passing)
 assignment requires a preparatory
 motion and then a test::
 With ``simplere``, you can do it in fewer steps::
-    from simplere import Re
+    from simplere import *
+    if match /, some_string):
+        print match[1]
+Or with an object-orented style:
     if some_string in Re(pattern):
         print Re._[1]
-``pattern`` here would typically be a string, but it can also be a pre-existing
-compiled regular expression. ``Re`` objects are `memoized
-<>`_ for efficiency, so they so they're
-only compiled once, regardless of how many times they're mentioned in the
+Re Objects
+``Re`` objects are `memoized
+<>`_ for efficiency, so they compile their
+pattern just once, regardless of how many times they're mentioned in a
 Note that the ``in`` test turns the sense of the matching around (compared to
-    version='0.4',
+    version='1.0',
     author='Jonathan Eunice',
     description='Simpler, cleaner access to regular expressions. Globs too.',

File simplere/

 also simpler access to globs.
-from mementos import MementoMetaclass, with_metaclass    
-import sys, re, fnmatch
+from mementos import MementoMetaclass, with_metaclass
+import sys
+import re
+import fnmatch
 _PY3 = sys.version_info[0] == 3
 if _PY3:
     basestring = str
 class ReMatch(object):
     An easier-to-use proxy for regular expression match objects. Ideally this
     would be a subclass of the re module's match object, but their type
     change the name of the match group or access the underlying property thus:
     def __init__(self, match=None):
         self._match = match
         self._groupdict = None
         __bool__ = _bool
         __nonzero__ = _bool
     def __getattr__(self, name):
         if self._match is None:
-            raise AttributeError("Empty match has no such attribute '{}'".format(name))
+            raise AttributeError(
+                "Empty match has no such attribute '{}'".format(name))
         if self._groupdict is None:
             self._groupdict = self._match.groupdict()
     def __getitem__(self, index):
     def __div__(self, other):
         Define the div (/) operation for en passant usage.
         return, string, *args, **kwargs)
     def escape(self, *args, **kwargs):
-        return*args, **kwargs)
+        return*args, **kwargs)        
 class Glob(with_metaclass(MementoMetaclass, object)):