-
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.
Allow the use of sequence names (#36)
* This enables avoiding imports * It is not a breaking change, the old way still works --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
87dbd8d
commit ea7fa05
Showing
8 changed files
with
63 additions
and
33 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
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
from coquille import Coquille | ||
from coquille.sequences import bold | ||
from coquille.sequences import fg_magenta | ||
from coquille.sequences import italic | ||
|
||
print("Hello World!") | ||
|
||
# By default, the coquille wraps the standard output | ||
with Coquille.new(fg_magenta, italic) as coquille: | ||
with Coquille.new("fg_magenta", "italic") as coquille: | ||
print("Hello World, but in magenta and italic!") | ||
coquille.apply(bold) | ||
coquille.apply("bold") | ||
print("Now, with a touch of bold :D") | ||
|
||
print("Oh, we are back to normal now...") |
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 |
---|---|---|
@@ -1,12 +1,8 @@ | ||
from coquille import write | ||
from coquille.sequences import bold | ||
from coquille.sequences import fg_blue | ||
from coquille.sequences import fg_magenta | ||
from coquille.sequences import italic | ||
|
||
print("Hello World!") | ||
|
||
write("Hello World, but in magenta and italic!", fg_magenta, italic) | ||
write("Hello World, but in magenta and italic!", "fg_magenta", "italic") | ||
|
||
with open("examples/write/output.txt", "w") as my_file: | ||
write("A pretty Hello World in a file!", fg_blue, bold, file=my_file) | ||
write("A pretty Hello World in a file!", "fg_blue", "bold", file=my_file) |
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 |
---|---|---|
@@ -1 +1 @@ | ||
from coquille.coquille import * | ||
from coquille.prelude import * |
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
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