-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Suspir0n/develop
finish creation library in python
- Loading branch information
Showing
8 changed files
with
78 additions
and
17 deletions.
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 |
---|---|---|
|
@@ -139,4 +139,7 @@ dmypy.json | |
cython_debug/ | ||
|
||
# VS Code | ||
.vscode/ | ||
.vscode/ | ||
|
||
# my files | ||
settings.py |
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,17 @@ | ||
MIT License | ||
Copyright (c) 2018 Evandro Silva | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "ctext"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "ctext", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,19 @@ | ||
def to_center(text, space, object=str()): | ||
""" | ||
This function is reponsible for centralizing the text. accepted at least two vestments. | ||
:param text: receive any text, only string. | ||
:param space: receive any value, only numbers. | ||
:param object: receive any object, ex: - . = ~ < > _ | between others. | ||
:return: The text centralized. | ||
""" | ||
try: | ||
if object == '': | ||
receive = f'{text:^{space}}' | ||
else: | ||
receive = f'{text:{object}^{space}}' | ||
except ValueError as err: | ||
return f'information value invalid, {err}' | ||
except TypeError as err: | ||
return f'The type value invalid, {err}' | ||
else: | ||
return receive |
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,2 @@ | ||
pytest==6.2.3 | ||
twine==3.4.1 |
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,2 @@ | ||
[metadata] | ||
description-file=README.md |
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,18 @@ | ||
from setuptools import setup | ||
from settings import NAME, VERSION, DESCRIPTION, LINCENSE, PACKAGES, AUTHOR, INSTALL_REQUIRES, SETUP_REQUIRES, TESTS_REQUIRES, TESTS_SUITE, AUTHOR_EMAIL, DOWNLOAD_URL, URL | ||
|
||
setup( | ||
name=NAME, | ||
packages=PACKAGES, | ||
version=VERSION, | ||
description=DESCRIPTION, | ||
author=AUTHOR, | ||
license=LINCENSE, | ||
install_requires=INSTALL_REQUIRES, | ||
setup_requires=SETUP_REQUIRES, | ||
tests_requires=TESTS_REQUIRES, | ||
tests_suite=TESTS_SUITE, | ||
author_email=AUTHOR_EMAIL, | ||
url=URL, | ||
download_url=DOWNLOAD_URL, | ||
) |
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,16 @@ | ||
from ctext.center import to_center | ||
|
||
def test_to_center_happy_way(): | ||
receive_valid_one = to_center('Olá Mundo', 20) | ||
receive_valid_two = to_center('Olá Mundo', '20') | ||
receive_valid_three = to_center('Olá Mundo', 20, '=') | ||
assert receive_valid_one | ||
assert receive_valid_two | ||
assert receive_valid_three | ||
|
||
|
||
def test_to_center_happ_say(): | ||
receive_invalid = to_center('Olá Mundo', 'a') | ||
assert receive_invalid | ||
|
||
|