-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added toNFC and toNFD command-line scripts and bumped version to 0.3
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ sudo: false | |
python: | ||
- "3.6" | ||
- "3.7" | ||
- "3.8" | ||
install: | ||
- pip install flake8 | ||
- pip install coveralls | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import fileinput | ||
import sys | ||
|
||
from .utils import nfc, nfd | ||
|
||
|
||
def convert(func): | ||
lines_changed = 0 | ||
|
||
with fileinput.input() as f: | ||
for line in f: | ||
text = func(line) | ||
print(text, end="") | ||
if text != line: | ||
lines_changed += 1 | ||
|
||
print(f"{lines_changed} lines changed", file=sys.stderr) | ||
|
||
|
||
def to_nfc(): | ||
convert(nfc) | ||
|
||
|
||
def to_nfd(): | ||
convert(nfd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters