Skip to content

Commit dafa794

Browse files
committed
Improved various things + new release
1 parent 251f652 commit dafa794

6 files changed

Lines changed: 14 additions & 7 deletions

File tree

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ exclude_lines =
1010
pragma: no cover
1111
if.*?__name__.*?==.*?.__main__.:
1212
def main\(\)\:
13+
def __stdin_pipe\(\)\:
1314
except ImportError:
1415
except NameError:
1516
raise NotImplementedError

codext/__info__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
44
"""
55
import os
6+
from datetime import datetime
67

78
__author__ = "Alexandre D'Hondt"
8-
__copyright__ = "© 2019 A. D'Hondt"
9+
__copyright__ = "© 2019-{} A. D'Hondt".format(datetime.now().year)
910
__email__ = "alexandre.dhondt@gmail.com"
1011
__license__ = "AGPLv3 (http://www.gnu.org/licenses/agpl.html)"
1112
__source__ = "https://github.com/dhondta/python-codext"

codext/languages/morse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
}
2828

2929

30-
add_map("morse", ENCMAP, "#", " ", pattern=r"^morse([-_]?.{3})?$")
30+
add_map("morse", ENCMAP, "#", " ", ignore_case=True, pattern=r"^morse([-_]?.{3})?$")

docs/base.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
`codext` defines a far broader set of Base-encodings than in the original library.
2+
3+
-----
4+
15
### Classical base 2^N encodings
26

37
This namely adds the classical BaseXX encodings like 16 (hexadecimal) and 32 (RFC 3548), which are not available in the native codecs.

docs/encodings.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ It support only letters.
3333

3434
**Codec** | **Conversions** | **Aliases** | **Comment**
3535
:---: | :---: | --- | ---
36-
`bacon` | bacon <-> text | `bacon-cipher`, `baconian_cipher`, `bacon-01` | Dynamic tokens mapping ; we can define a mapping of encoding's tokens (original tokens: `ab`)
36+
`bacon` | Bacon <-> text | `bacon-cipher`, `baconian_cipher`, `bacon-01` | Dynamic tokens mapping ; we can define a mapping of encoding's tokens (original tokens: `ab`)
3737

3838
```python
3939
>>> codext.encode("this is a test", "bacon")
@@ -52,7 +52,7 @@ It supports letters, digits and some special characters.
5252

5353
**Codec** | **Conversions** | **Aliases** | **Comment**
5454
:---: | :---: | --- | ---
55-
`braille` | braille <-> text | none | Python 3 only
55+
`braille` | Braille <-> text | none | Python 3 only
5656

5757
```python
5858
>>> codext.encode("this is a test", "braille")
@@ -96,7 +96,7 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
9696

9797
**Codec** | **Conversions** | **Aliases** | **Comment**
9898
:---: | :---: | --- | ---
99-
`leetspeak` | leetspeak <-> text | `leet`, `1337`, `leetspeak` | based on minimalistic elite speaking rules
99+
`leetspeak` | LeetSpeak <-> text | `leet`, `1337`, `leetspeak` | based on minimalistic elite speaking rules
100100

101101
```python
102102
>>> codext.encode("this is a test", "leetspeak")
@@ -117,7 +117,7 @@ This is only for "encoding" (converting) Markdown to HTML.
117117

118118
**Codec** | **Conversions** | **Aliases** | **Comment**
119119
:---: | :---: | --- | ---
120-
`markdown` | markdown --> HTML | `markdown`, `Markdown`, `md` | unidirectional !
120+
`markdown` | Markdown --> HTML | `markdown`, `Markdown`, `md` | unidirectional !
121121

122122
```python
123123
>>> codext.encode("# Test\nparagraph", "markdown")
@@ -132,7 +132,7 @@ It supports of course letters and digits, but also a few special characters: `.,
132132

133133
**Codec** | **Conversions** | **Aliases** | **Comment**
134134
:---: | :---: | --- | ---
135-
`morse` | morse <-> text | none | uses whitespace as a separator, dynamic tokens mapping ; we can define a mapping of encoding's tokens (original tokens: `/-.`)
135+
`morse` | Morse <-> text | none | uses whitespace as a separator, dynamic tokens mapping ; we can define a mapping of encoding's tokens (original tokens: `/-.`)
136136

137137
```python
138138
>>> codext.encode("this is a test", "morse")

tests/test_morse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def test_codec_morse(self):
1919
TFILE = "test-codec-morse.txt"
2020
self.assertTrue(isinstance(codecs.encode(STR, "morse"), string_types))
2121
self.assertEqual(codecs.encode(STR, "morse"), MRS)
22+
self.assertEqual(codecs.encode(STR, "morse"), codecs.encode(STR.upper(), "morse"))
2223
self.assertRaises(ValueError, codecs.encode, STRB, "morse")
2324
self.assertIsNotNone(codecs.encode(STRB, "morse", "replace"))
2425
self.assertIsNotNone(codecs.encode(STRB, "morse", "ignore"))

0 commit comments

Comments
 (0)