outputformat 0.1.3__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Felipe Delestro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,24 @@
1
+ Metadata-Version: 2.4
2
+ Name: outputformat
3
+ Version: 0.1.4
4
+ Summary: Decorate and beautify output
5
+ Home-page: https://github.com/delestro/outputformat
6
+ Download-URL: https://github.com/delestro/outputformat/archive/refs/tags/v0.1.4.tar.gz
7
+ Author: Felipe Delestro
8
+ Author-email: delestro@gmail.com
9
+ License: MIT
10
+ Keywords: output,print,decorate,format,string,beautify
11
+ Requires-Python: >=3.6
12
+ License-File: LICENSE
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: description
16
+ Dynamic: download-url
17
+ Dynamic: home-page
18
+ Dynamic: keywords
19
+ Dynamic: license
20
+ Dynamic: license-file
21
+ Dynamic: requires-python
22
+ Dynamic: summary
23
+
24
+ For usage, check https://delestro.com/2022/01/16/outputformat/
@@ -45,7 +45,7 @@ def linetitle(txt, style="-", color=False, cmap="cool", bold=False, return_str=F
45
45
  outputstring = ""
46
46
 
47
47
  txt = str(txt)
48
- txt_size = len(txt)
48
+ txt_size = ouf.tools.real_string_length(txt)
49
49
  style = str(style)
50
50
 
51
51
  # bl = bottom left
@@ -114,7 +114,7 @@ def boxtitle(txt, style="-", return_str=False, color=False, cmap="cool", bold=Fa
114
114
  """
115
115
 
116
116
  txt = str(txt)
117
- txt_size = len(txt)
117
+ txt_size = ouf.tools.real_string_length(txt)
118
118
  style = str(style)
119
119
 
120
120
  if style in ["line", "-"]:
@@ -3,6 +3,7 @@ from outputformat.title import boxtitle
3
3
  from outputformat import emoji
4
4
  import colorsys
5
5
  from random import random
6
+ from re import sub
6
7
 
7
8
 
8
9
  def prepare_data(input_data, precision):
@@ -203,3 +204,15 @@ def parse_color(color, cmap):
203
204
  color = (random(), default_saturation, 1)
204
205
 
205
206
  return color
207
+
208
+ def real_string_length(txt):
209
+ """Compute the length of the strings without the ANSI escape sequences
210
+
211
+ Returns
212
+ -------
213
+ int
214
+ real length of the string txt
215
+
216
+ """
217
+ pattern = "\x1b\[[;\d]*m"
218
+ return len(sub(pattern,"",txt))
@@ -0,0 +1,24 @@
1
+ Metadata-Version: 2.4
2
+ Name: outputformat
3
+ Version: 0.1.4
4
+ Summary: Decorate and beautify output
5
+ Home-page: https://github.com/delestro/outputformat
6
+ Download-URL: https://github.com/delestro/outputformat/archive/refs/tags/v0.1.4.tar.gz
7
+ Author: Felipe Delestro
8
+ Author-email: delestro@gmail.com
9
+ License: MIT
10
+ Keywords: output,print,decorate,format,string,beautify
11
+ Requires-Python: >=3.6
12
+ License-File: LICENSE
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: description
16
+ Dynamic: download-url
17
+ Dynamic: home-page
18
+ Dynamic: keywords
19
+ Dynamic: license
20
+ Dynamic: license-file
21
+ Dynamic: requires-python
22
+ Dynamic: summary
23
+
24
+ For usage, check https://delestro.com/2022/01/16/outputformat/
@@ -1,4 +1,6 @@
1
+ LICENSE
1
2
  README.md
3
+ pyproject.toml
2
4
  setup.py
3
5
  outputformat/__init__.py
4
6
  outputformat/color.py
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -3,13 +3,13 @@ from setuptools import setup
3
3
  setup(
4
4
  name="outputformat",
5
5
  packages=["outputformat"],
6
- version="0.1.3",
6
+ version="0.1.4",
7
7
  description="Decorate and beautify output",
8
8
  long_description="For usage, check https://delestro.com/2022/01/16/outputformat/",
9
9
  author="Felipe Delestro",
10
10
  author_email="delestro@gmail.com",
11
11
  url="https://github.com/delestro/outputformat",
12
- download_url="https://github.com/delestro/outputformat/archive/refs/tags/v0.1.3.tar.gz",
12
+ download_url="https://github.com/delestro/outputformat/archive/refs/tags/v0.1.4.tar.gz",
13
13
  license="MIT",
14
14
  keywords=["output", "print", "decorate", "format", "string", "beautify"],
15
15
  python_requires=">=3.6",
@@ -1,13 +0,0 @@
1
- Metadata-Version: 1.2
2
- Name: outputformat
3
- Version: 0.1.3
4
- Summary: Decorate and beautify output
5
- Home-page: https://github.com/delestro/outputformat
6
- Author: Felipe Delestro
7
- Author-email: delestro@gmail.com
8
- License: MIT
9
- Download-URL: https://github.com/delestro/outputformat/archive/refs/tags/v0.1.3.tar.gz
10
- Description: For usage, check https://delestro.com/2022/01/16/outputformat/
11
- Keywords: output,print,decorate,format,string,beautify
12
- Platform: UNKNOWN
13
- Requires-Python: >=3.6
@@ -1,13 +0,0 @@
1
- Metadata-Version: 1.2
2
- Name: outputformat
3
- Version: 0.1.3
4
- Summary: Decorate and beautify output
5
- Home-page: https://github.com/delestro/outputformat
6
- Author: Felipe Delestro
7
- Author-email: delestro@gmail.com
8
- License: MIT
9
- Download-URL: https://github.com/delestro/outputformat/archive/refs/tags/v0.1.3.tar.gz
10
- Description: For usage, check https://delestro.com/2022/01/16/outputformat/
11
- Keywords: output,print,decorate,format,string,beautify
12
- Platform: UNKNOWN
13
- Requires-Python: >=3.6
File without changes
File without changes