Skip to content

Commit

Permalink
This is a major overhaul and a replacement of pretty much the whole c…
Browse files Browse the repository at this point in the history
…odebase.

This version 2.0 is now fully object oriented and fully compatible to
GNU sed v4.8 with all it's bells and whissles.

The only things not implemented are character classes (no support in
Python regex) and the command e (might still come in a later update).

The case-modifying escapes \L, \l, \U, \u and \E in the replacement
string are now supported as well.

The GNU sed v4.8 documentation can be used as a reference for pythonsed.

All testcase - except the two for character classes and command e -
are passing now.

Testcases for the new commands v,R and W have been added as well as
a test script (test_script_inplace.py) to test the in-place editiing.

I also added the possibility to use the much more powerful Python
syntax for the regex in addresses and s command by specifying the
-p or --python-syntax option.

Note the different handling of empty matches in those cases, depending
on the Python version and if -p is used or not...
  • Loading branch information
fschaeck committed Apr 21, 2021
1 parent 28da257 commit 70b5689
Show file tree
Hide file tree
Showing 30 changed files with 3,110 additions and 1,406 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# compiled Python files
*.pyc
__pycache__

# generated test files
test-tmp-*
tests/script.good
tests/script.inp
tests/script.sed

# Metafiles for Eclipse
.project
.pydevproject
.settings/
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ install:

script:
- if [ $TRAVIS_PYTHON_VERSION != '2.7' ]; then coverage run tests/test_script_io.py; fi
- coverage run tests/test-suite.py @all-tests.suites -x test-python-sed-3.7.exclude
- coverage run tests/test_script_inplace.py
- coverage run tests/test-suite.py @all-tests.suites -x test-python-sed.exclude

after_success:
- coveralls

0 comments on commit 70b5689

Please sign in to comment.