Skip to content

Commit

Permalink
Added animations
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakama3942 committed Jun 18, 2023
1 parent 6a4dd77 commit 83d11fa
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 15 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Any information to the output can be turned off (according to the default, every
- [x] v0.5.0 - Unifying update (console and HTML are combined into one class)
- [x] v0.5.1 - Hints update (added status message templates and hint symbols (icons) near log entries status)
- [x] v0.6.0 - Progress update (added start of some log entries in threads (process))
- [ ] v0.6.1 - Animation update (added animations in processes)
- [x] v0.6.1 - Animation update (added animations in processes)
- [ ] v0.7.0 - "Buffer improvement" update (added buffer clearing and loading)
- [ ] v0.7.1 - Conversion update (added conversion from Console type to HTML and vice versa)
- [ ] v0.7.2 - Search update (added search by log entry types)
Expand Down Expand Up @@ -139,8 +139,8 @@ from mighty_logger import Logger
from mighty_logger.src import StatusMessagePatterns

if __name__ == "__main__":
logger = Logger(program_name="Test", console_width=115)
logger.message(status_message=StatusMessagePatterns.custom("Hooray"), message_text="Hello world!")
logger = Logger(program_name="Test", console_width=115)
logger.message(status_message=StatusMessagePatterns.custom("Hooray"), message_text="Hello world!")
```

The outputs in console will contain the following text (GitHub, PyPi and possibly some other sites do not support displaying colors in Markdown - use resources that support them, such as PyCharm):
Expand Down Expand Up @@ -175,14 +175,14 @@ All functionality of the library has been tested by me, but if you have problems
## Authors

<table align="center" style="border-width: 10; border-style: ridge">
<tr>
<td align="center"><a href="https://github.com/Nakama3942"><img src="https://avatars.githubusercontent.com/u/73797846?s=400&u=a9b7688ac521d739825d7003a5bd599aab74cb76&v=4" width="150px;" alt=""/><br /><sub><b>Kalynovsky Valentin</b></sub></a><sub><br />"Ideological inspirer and Author"</sub></td>
<!--<td></td>-->
</tr>
<tr>
<td align="center"><a href="https://github.com/Nakama3942"><img src="https://avatars.githubusercontent.com/u/73797846?s=400&u=a9b7688ac521d739825d7003a5bd599aab74cb76&v=4" width="150px;" alt=""/><br /><sub><b>Kalynovsky Valentin</b></sub></a><sub><br />"Ideological inspirer and Author"</sub></td>
<!--<td></td>-->
</tr>
<!--
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
-->
</table>
8 changes: 8 additions & 0 deletions docs/APPLYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,3 +523,11 @@ Log:
</pre>

*Attention! The program runs for about 40 seconds.*

### Empty entry (available since v0.6.0)

Will be added in v0.9.1.

### Timer (available since v0.6.1)

Will be added in v0.9.1.
90 changes: 88 additions & 2 deletions docs/DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The library stores various important data for use that you may need to know whil

###### Entry types (and icon in set):
- No category
- empty
- empty (v0.6.0)
- Debugging (%)
- debug
- debug_performance
Expand Down Expand Up @@ -115,6 +115,45 @@ The library stores various important data for use that you may need to know whil
- `StatusMessagePatterns.closed()`
- `StatusMessagePatterns.empty()`
- `StatusMessagePatterns.custom("")`

###### Animations:
- Indefinite Animations
- Dots
- Wave
- WaveAutoReverse
- Star (v0.6.1)
- StarAutoReverse (v0.6.1)
- StarHorizontalFill (v0.6.1)
- StarHorizontalFillAutoReverse (v0.6.1)
- Arrow (v0.6.1)
- ArrowAutoReverse (v0.6.1)
- Sunrise (v0.6.1)
- Sunset (v0.6.1)
- SunriseSunset (v0.6.1)
- Clock1
- Clock2
- Clock3
- Circle
- KnightRider
- KnightRiderAutoReverse
- Blocks1
- Blocks2
- Blocks3
- Blocks4
- BlocksAutoReverse
- Line
- LineAutoReverse
- BlockVerticalFill
- BlockVerticalFillAutoReverse
- BlockHorizontalFillAutoReverse
- SuperSpace (v0.6.1)
- Definite Animations
- Dots
- Star (v0.6.1)
- Arrow (v0.6.1)
- KnightRider
- Line
- BlockVerticalFill
<!--
###### Searching:
- ? - entry (no)
Expand All @@ -127,7 +166,6 @@ The library stores various important data for use that you may need to know whil
- & - type: Process
- ^ - type: Timer
- $ - free
- ^ - free
-->
###### X11 color table:
- Red category:
Expand Down Expand Up @@ -365,12 +403,42 @@ The library stores various important data for use that you may need to know whil
| TYPE_CRITICAL | FIREBRICK | DARKSALMON |
| CRITICAL_MESSAGE | DARKRED | LIGHTSALMON |
| CRITICAL_BACKGROUND | - | MAROON |
| RESOLVED_TIME | ORCHID | LAVENDERBLUSH |
| RESOLVED_STATUS | ORANGE | CHARTREUSE |
| RESOLVED_STATUS_MESSAGE | DARKORANGE | LAWNGREEN |
| TYPE_RESOLVED | GREEN | PALEGREEN |
| RESOLVED_MESSAGE | DARKGREEN | LIGHTGREEN |
| RESOLVED_BACKGROUND | - | DARKGREEN |
| UNRESOLVED_TIME | ORCHID | LAVENDERBLUSH |
| UNRESOLVED_STATUS | ORANGE | ORANGE |
| UNRESOLVED_STATUS_MESSAGE | DARKORANGE | DARKORANGE |
| TYPE_UNRESOLVED | FIREBRICK | YELLOW |
| UNRESOLVED_MESSAGE | DARKRED | DARKYELLOW |
| UNRESOLVED_BACKGROUND | - | DARKRED |
| INITIATION_TIME | ORCHID | LAVENDERBLUSH |
| INITIATION_STATUS | ORANGE | CHARTREUSE |
| INITIATION_STATUS_MESSAGE | DARKORANGE | LAWNGREEN |
| TYPE_INITIATION | GREEN | PALEGREEN |
| INITIATION_MESSAGE | DARKGREEN | LIGHTGREEN |
| INITIATION_BACKGROUND | - | DARKGREEN |
| PROGRESS_TIME | ORCHID | PURPLE |
| PROGRESS_STATUS | ORANGE | DARKRED |
| PROGRESS_STATUS_MESSAGE | DARKORANGE | MAROON |
| TYPE_PROGRESS | LIGHTSKYBLUE | NAVY |
| PROGRESS_MESSAGE | SKYBLUE | MIDNIGHTBLUE |
| PROGRESS_BACKGROUND | - | SKYBLUE |
| ACHIEVEMENT_TIME | ORCHID | DARKMAGENTA |
| ACHIEVEMENT_STATUS | ORANGE | DARKRED |
| ACHIEVEMENT_STATUS_MESSAGE | DARKORANGE | MAROON |
| TYPE_ACHIEVEMENT | YELLOW | NAVY |
| ACHIEVEMENT_MESSAGE | DARKYELLOW | MIDNIGHTBLUE |
| ACHIEVEMENT_BACKGROUND | - | DARKYELLOW |
| MILESTONE_TIME | ORCHID | LAVENDERBLUSH |
| MILESTONE_STATUS | ORANGE | CHARTREUSE |
| MILESTONE_STATUS_MESSAGE | DARKORANGE | LAWNGREEN |
| TYPE_MILESTONE | GREEN | PALEGREEN |
| MILESTONE_MESSAGE | DARKGREEN | LIGHTGREEN |
| MILESTONE_BACKGROUND | - | DARKGREEN |
| SUCCESS_TIME | ORCHID | LAVENDERBLUSH |
| SUCCESS_STATUS | ORANGE | CHARTREUSE |
| SUCCESS_STATUS_MESSAGE | DARKORANGE | LAWNGREEN |
Expand All @@ -383,6 +451,24 @@ The library stores various important data for use that you may need to know whil
| TYPE_FAIL | FIREBRICK | YELLOW |
| FAIL_MESSAGE | DARKRED | DARKYELLOW |
| FAIL_BACKGROUND | - | DARKRED |
| START_TIMER_TIME | ORCHID | LAVENDERBLUSH |
| START_TIMER_STATUS | ORANGE | CHARTREUSE |
| START_TIMER_STATUS_MESSAGE | DARKORANGE | LAWNGREEN |
| TYPE_START_TIMER | SEAGREEN | PALEGREEN |
| START_TIMER_MESSAGE | FORESTGREEN | LIGHTGREEN |
| START_TIMER_BACKGROUND | - | FORESTGREEN |
| TIMER_MARK_TIME | ORCHID | DARKMAGENTA |
| TIMER_MARK_STATUS | ORANGE | DARKRED |
| TIMER_MARK_STATUS_MESSAGE | DARKORANGE | MAROON |
| TYPE_TIMER_MARK | KHAKI | SIENNA |
| TIMER_MARK_MESSAGE | DARKKHAKI | SADDLEBROWN |
| TIMER_MARK_BACKGROUND | - | DARKKHAKI |
| STOP_TIMER_TIME | ORCHID | PURPLE |
| STOP_TIMER_STATUS | ORANGE | DARKRED |
| STOP_TIMER_STATUS_MESSAGE | DARKORANGE | MAROON |
| TYPE_STOP_TIMER | LIGHTSKYBLUE | NAVY |
| STOP_TIMER_MESSAGE | SKYBLUE | MIDNIGHTBLUE |
| STOP_TIMER_BACKGROUND | - | SKYBLUE |

###### Tree of ANSI escape code:
- reset
Expand Down
121 changes: 121 additions & 0 deletions mighty_logger/text/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,34 @@ class IndefiniteAnimations:
'**......',
'*.......'
])
Arrow = IndefiniteAnimationType([
'>-------',
'->------',
'-->-----',
'--->----',
'---->---',
'----->--',
'------>-',
'------->'
])
ArrowAutoReverse = IndefiniteAnimationType([
'>-------',
'->------',
'-->-----',
'--->----',
'---->---',
'----->--',
'------>-',
'------->',
'-------<',
'------<-',
'-----<--',
'----<---',
'---<----',
'--<-----',
'-<------',
'<-------'
])
Sunrise = IndefiniteAnimationType([
'________',
'___/\___',
Expand Down Expand Up @@ -345,6 +373,88 @@ class IndefiniteAnimations:
' ▍ ',
' ▎ '
])
SuperSpace = IndefiniteAnimationType([
'........',
'X.......',
'.X......',
'..X.....',
'...X....',
'....X...',
'.....X..',
'......X.',
'.......X',
'X.....X.',
'.X...X..',
'..X.X...',
'...X....',
'..X.X...',
'.X...X..',
'X.....X.',
'.......X',
'X.....X.',
'.X...X..',
'X.X.X...',
'.X.X....',
'..X.X...',
'.X.X.X..',
'X...X.X.',
'.....X.X',
'X.....X.',
'.X...X.X',
'X.X.X.X.',
'.X.X.X..',
'X.X.X...',
'.X.X.X..',
'X.X.X.X.',
'.X.X.X.X',
'X...X.X.',
'.X...X.X',
'X.X.X.X.',
'.X.X.X.X',
'X.X.X.X.',
'.X.X.X..',
'X.X.X.X.',
'.X.X.X.X',
'X.X.X.X.',
'.X.X.X.X',
'X.X.X.X.',
'.X.X.X.X',
'X.X.X.X.',
'.X.X.X.X',
'X.X.X.X.',
'.X.X.X.X',
'..X.X.X.',
'.X.X.X..',
'X.X.X...',
'.X.X....',
'X.X.....',
'.X......',
'X.X.....',
'.X.X....',
'..X.X...',
'...X.X..',
'....X.X.',
'.....X.X',
'......X.',
'.......X',
'......X.',
'.....X..',
'....X...',
'...X....',
'..X.....',
'.X......',
'X.......',
'........',
'.X....X.',
'X.X..X.X',
'.X.XX.X.',
'..X..X..',
'...XX...',
'........',
'........',
'........',
'........'
])

class DefiniteAnimations:
"""
Expand Down Expand Up @@ -372,6 +482,17 @@ class DefiniteAnimations:
'*******.',
'********'
])
Arrow = DefiniteAnimationType([
'--------',
'>-------',
'>>------',
'=>>-----',
'==>>----',
'===>>---',
'====>>--',
'=====>>-',
'======>>'
])
KnightRider = DefiniteAnimationType([
'▫▫▫▫▫▫▫▫',
'▪▫▫▫▫▫▫▫',
Expand Down
4 changes: 2 additions & 2 deletions test/test_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
logger.start_timer(message_text="Timer started")

sleep(1)
logger.start_indefinite_process(animation=IndefiniteAnimations.Star, message_text="File upload")
logger.start_indefinite_process(animation=IndefiniteAnimations.SuperSpace, message_text="File upload")
sleep(2)
logger.note_process(entry_type=TypesEntries.ACHIEVEMENT, message_text="Files downloaded")
sleep(3)
Expand All @@ -22,7 +22,7 @@
logger.timer_mark(message_text="Timer mark", local_background=False)

sleep(1)
logger.start_definite_process(progress_bar=DefiniteAnimations.Dots, message_text="Installing files")
logger.start_definite_process(progress_bar=DefiniteAnimations.Arrow, message_text="Installing files")
sleep(0.6)
logger.progress_rise(3)
sleep(0.4)
Expand Down

0 comments on commit 83d11fa

Please sign in to comment.