-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add ability for effects to use matched value * build: add python path to docker image * docs: update doc and add new examples --------- Signed-off-by: Emilio Reyes <[email protected]>
- Loading branch information
Showing
53 changed files
with
1,213 additions
and
1,199 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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
ARG PYTHON_VERSION=3.9 | ||
ARG PYTHON_VERSION=3.12 | ||
FROM python:${PYTHON_VERSION}-slim | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV TERM=xterm-256color | ||
ENV PYTHONPATH=/code/examples/ | ||
WORKDIR /code | ||
COPY . /code/ | ||
RUN pip install --upgrade pip && \ | ||
pip install pybuilder namegenerator | ||
pip install pybuilder namegenerator faker | ||
RUN pyb -X |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,15 @@ | ||
screen_layout = { | ||
'range_header': { | ||
'position': (2, 5), 'text': 'Range', 'text_color': 14 }, | ||
'prime_header': { | ||
'position': (2, 14), 'text': 'Prime', 'text_color': 14 }, | ||
'number': { | ||
'position': (3, 2), 'color': 15, 'zfill': 5, | ||
'regex': r'^checking number (?P<value>\d+)$' }, | ||
'upper': { | ||
'position': (3, 7), 'color': 27, | ||
'regex': r'^checking primes between \d+(?P<value>/\d+)$' }, | ||
'prime': { | ||
'position': (3, 14), 'color': 2, 'keep_count': True, 'zfill': 4, | ||
'regex': r'^\d* is prime$' } | ||
} |
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,13 @@ | ||
from primes import count_primes | ||
from layout import screen_layout | ||
from mpcurses import MPcurses | ||
|
||
def main(): | ||
MPcurses( | ||
function=count_primes, | ||
process_data=[ | ||
{'nrange': '1-10000'}], | ||
screen_layout=screen_layout).execute() | ||
|
||
if __name__ == '__main__': | ||
main() |
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 @@ | ||
screen_layout = { | ||
'range_header': { | ||
'position': (2, 5), 'text': 'Range', 'text_color': 14 }, | ||
'prime_header': { | ||
'position': (2, 14), 'text': 'Prime', 'text_color': 14 }, | ||
'number': { | ||
'position': (3, 2), 'color': 15, 'table': True, | ||
'regex': r'^checking number (?P<value>\d+)$' }, | ||
'upper': { | ||
'position': (3, 7), 'color': 27, 'table': True, | ||
'regex': r'^checking primes between \d+(?P<value>/\d+)$' }, | ||
'prime': { | ||
'position': (3, 14), 'color': 2,'keep_count': True, 'zfill': 4, | ||
'regex': r'^\d* is prime$' }, | ||
'_counter_': { | ||
'position': (3, 19), 'color': 15, 'modulus': 125, 'counter_text': chr(9632), | ||
'categories': ['number'] } | ||
} |
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,13 @@ | ||
from primes import count_primes | ||
from layout import screen_layout | ||
from mpcurses import MPcurses | ||
|
||
def main(): | ||
MPcurses( | ||
function=count_primes, | ||
process_data=[ | ||
{'nrange': '1-10000'}], | ||
screen_layout=screen_layout).execute() | ||
|
||
if __name__ == '__main__': | ||
main() |
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,23 @@ | ||
screen_layout = { | ||
'range_header': { | ||
'position': (2, 5), 'text': 'Range', 'text_color': 14 }, | ||
'prime_header': { | ||
'position': (2, 14), 'text': 'Prime', 'text_color': 14 }, | ||
'number': { | ||
'position': (3, 2), 'color': 15, 'table': True, | ||
'regex': r'^checking number (?P<value>\d+)$' }, | ||
'upper': { | ||
'position': (3, 7), 'color': 27, 'table': True, | ||
'regex': r'^checking primes between \d+(?P<value>/\d+)$' }, | ||
'prime': { | ||
'position': (3, 14), 'color': 2, 'table': True, 'keep_count': True, 'zfill': 4, | ||
'regex': r'^\d* is prime$' }, | ||
'_counter_': { | ||
'position': (3, 19), 'color': 15, 'table': True, 'modulus': 125, 'counter_text': chr(9632), | ||
'categories': ['number'] }, | ||
'total_header': { | ||
'position': (6, 7), 'text': 'Total:', 'text_color': 14 }, | ||
'total': { | ||
'position': (6, 14), 'color': 2, 'keep_count': True, 'zfill': 4, | ||
'regex': r'^\d* is prime$' }, | ||
} |
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 @@ | ||
from primes import count_primes | ||
from layout import screen_layout | ||
from mpcurses import MPcurses | ||
|
||
def main(): | ||
MPcurses( | ||
function=count_primes, | ||
process_data=[ | ||
{'nrange': '00001-10000'}, | ||
{'nrange': '10001-20000'}, | ||
{'nrange': '20001-30000'}, | ||
{'nrange': '30001-40000'}, | ||
{'nrange': '40001-50000'}, | ||
{'nrange': '50001-60000'}, | ||
{'nrange': '60001-70000'}], | ||
screen_layout=screen_layout).execute() | ||
|
||
if __name__ == '__main__': | ||
main() |
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,58 @@ | ||
|
||
screen_layout = { | ||
'total': { | ||
'position': (1, 6), | ||
'text': 'Total:', | ||
'text_color': 0, | ||
'color': 15, | ||
'regex': r'^(?P<value>\d+) total items$' | ||
}, | ||
'pass': { | ||
'position': (2, 7), | ||
'text': 'Pass:', | ||
'text_color': 0, | ||
'color': 2, | ||
'keep_count': True, | ||
'regex': r'^item ".*" was processed$' | ||
}, | ||
'warn': { | ||
'position': (3, 7), | ||
'text': 'Warn:', | ||
'text_color': 0, | ||
'color': 3, # 232, | ||
'keep_count': True, | ||
'regex': r'^warning processing item ".*"$' | ||
}, | ||
'fail': { | ||
'position': (4, 7), | ||
'text': 'Fail:', | ||
'text_color': 0, | ||
'color': 1, # 237, | ||
'keep_count': True, | ||
'regex': r'^error processing item ".*"$' | ||
}, | ||
'processing': { | ||
'position': (5, 1), | ||
'text': 'Processing:', | ||
'text_color': 0, | ||
'color': 14, | ||
'clear': True, | ||
'regex': r'^processing item "(?P<value>.*)"$' | ||
}, | ||
'processing_done': { | ||
'position': (5, 1), | ||
'replace_text': ' ', | ||
'clear': True, | ||
'regex': r'^processing complete$' | ||
}, | ||
'_counter_': { | ||
'position': (6, 0), | ||
'categories': [ | ||
'pass', | ||
'warn', | ||
'fail' | ||
], | ||
'counter_text': chr(9632), | ||
'width': 100 | ||
} | ||
} |
Oops, something went wrong.