Skip to content

Commit

Permalink
5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dkundih committed Aug 12, 2022
1 parent 989fea5 commit 409b363
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,6 @@ CHANGELOG
- type = dynamic is now type = script.
- introduction of type = dynamic to work with object methods in a loop presented wheelconfig method.
- wheelconfig is now a primary way to create applications in the terminal, available for static and dynamic class.

5.0.1 (12/08/2022)
- all particles put to public testing.
6 changes: 5 additions & 1 deletion _testassets/T_scriptConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ def set_name(self, amount = app.store('amount', 'int')):
@app.entry('show info', option_description = 'describes the car.', print_val = True)
def show_info(self):
return f'Car of the brand {self.brand}, speed {self.speed} from the country of {self.country}.'

@app.entry('text', option_description = 'describes the car.')
def show_info(self):
return print('nanan')

if __name__ == '__main__':
app.config(type = 'script', queue = True)
app.config(type = 'script')
print('Executed on:', duality.__version__)
2 changes: 1 addition & 1 deletion _testassets/T_staticConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def oduzimanje(x = t.store('x', 'int') , y = t.store('y', 'int')):
return rez

def initconfig(self):
t.config(type = 'static', queue = True)
t.config(type = 'static', queue = 'y')

a = App()

Expand Down
15 changes: 8 additions & 7 deletions duality/decorators/dualityapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def config(
enter_message : StringType = 'ENTER THE ',
method : StringType = 'descriptive',
alignment : StringType = 'newline',
queue: BooleanType = False,
queue: StringType = 'y',
show_dtypes: BooleanType = True,
show_confirmation : BooleanType = False,
color_mode : StringType = 'dark',
Expand All @@ -207,20 +207,20 @@ def config(
- display_headline - displays the desired headline.
- display_message - displays input value message.
- output_message - confirmation of the chosen value.
- break_key - key that breaks the loop while queue = True.
- break_key - key that breaks the loop while queue = 'y'.
- enter_message - enter choice message.
- method ('descriptive' - shows stored option_name and it's description.)
- method ('basic' - shows only the stored option_name.)
- alignment ('basic' - shows all stored option_name and option_description values in a row.)
- alignment ('newline' -shows all stored option_name and option_description values in a new line.)
- queue (True/False) - enables stacking of functions and executing them in a chain.
- queue - enables stacking of functions and executing them in a chain.
- show_dtypes (True/False) - shows the dtype of the input value.
- show_confirmation (True/False) - confirmation of the chosen option.
- color_mode ('dark' - for dark terminal.)
- color_mode ('light' - for light terminal.)
- custom_color_mode - custom dictionary set of colors.
- clear_screen (True/False) - clears the screen before starting the app
# DEFAULT: DualityApp.config(type : StringType = 'static', display_headline : StringType = 'AVAILABLE OPTIONS', display_message : StringType = 'ENTER THE OPTION: ', output_message : StringType = 'YOU HAVE CHOSEN: ', break_key : StringType = '0', enter_message : StringType = 'ENTER THE: ', method : StringType = 'descriptive', alignment : StringType = 'newline', queue : BooleanType = False, show_dtypes : BooleanType = True, show_confirmation : BooleanType = False, color_mode : StringType = 'dark', custom_color_mode : Dictionarytype = None, clear_screen : BooleanType = True).
# DEFAULT: DualityApp.config(type : StringType = 'static', display_headline : StringType = 'AVAILABLE OPTIONS', display_message : StringType = 'ENTER THE OPTION: ', output_message : StringType = 'YOU HAVE CHOSEN: ', break_key : StringType = '0', enter_message : StringType = 'ENTER THE: ', method : StringType = 'descriptive', alignment : StringType = 'newline', queue : StringType = 'y', show_dtypes : BooleanType = True, show_confirmation : BooleanType = False, color_mode : StringType = 'dark', custom_color_mode : Dictionarytype = None, clear_screen : BooleanType = True).
'''

self.clear_screen = clear_screen
Expand Down Expand Up @@ -315,7 +315,7 @@ def config(
elif method == 'none':
pass

if queue == False:
if queue == 'n':

self.option = input(self.display_message)
self.print_option = self.print_val_dict[self.option]
Expand Down Expand Up @@ -394,8 +394,9 @@ def config(
print(tmp_func(**self.individual_dict[self.clone_dict]))
print('')
self.yield_name += 1


if queue == True:
if queue == 'y':
# executes autoinit functions.
if self.contains_autoinit == True:
try:
Expand Down Expand Up @@ -464,7 +465,7 @@ def config(
print('')
self.yield_name += 1

if queue == 'wheel':
if queue == 'wheel' or queue == 'w':

# executes autoinit functions.
if self.contains_autoinit == True:
Expand Down
2 changes: 1 addition & 1 deletion duality/misc/_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

]
__license__ = 'Copyright © 2021- David Kundih. All rights reserved. Licensed under the Apache License, Version 2.0 | For more details about the license and terms of use visit the official duality documentation linked at https://github.com/dkundih/duality and https://pypi.org/project/duality'
__version__ = '5.0.0'
__version__ = '5.0.1'
__documentation__ = 'https://github.com/dkundih/duality | https://pypi.org/project/duality'
__contact__ = '[email protected] | [email protected]'
__donate__ = 'https://patreon.com/dkundih | https://buymeacoffee.com/dkundih'

0 comments on commit 409b363

Please sign in to comment.