Package: schnittstelle
SchnittstelleInstallationpip install schnittstelleImport# completerfromschnittstelleimportCompleter,CompleterStyle,RunnableCompleter# loaderfromschnittstelleimportLoader,LoaderStyle,RunnableLoader# decoratorsfromschnittstelleimportdecoratorsCompleter[âœ“] complete
[X] failWhile completer is drawing toprintusecompleter.print('string to print')UsewithstatementRecommendedwithCompleter(message='Dummy bar')ascompleter:# codepassThe object will auto complete when on exitingwithstatementYou may also exit usingcompleter.completeorcompleter.fail()Decoratorfromschnittstelleimportdecorators@decorators.Completer(message='foo bar')deffoo(s):# codeEverytime the function is called Completer will appearIn case of exception it is caught and runs the fail method of completerUsing this method you're not able to access completer class itselfInlinecompleter=Completer().init()# codecompleter.complete()# or completer.fail()Exit the completer usingcompleter.completeorcompleter.fail()RunnableNot recommendeddeffoo(s):# coderunnable=RunnableCompleter(foo,message='foo bar')runnable.run('foo')All arguments go into run methodIn case of exception it is caught and runs the fail method of completerUsing this method you're not able to access completer class itselfConfigurationstyleTakes in classCompleterStyleCompleterStyleStatic Constuctorsdefaultdefault settingsAttributesprefixcharacter before chardefault: [postfixcharacter after chardefault: ]successcolor of character when successfuldefault: GREENerrorcolor of character when unsuccessfuldefault: REDinfocolor of character in info messagesdefault: BLUELoaderThis is theprogress barclass of package[==   ] Dummy barWhile the progress bar is in progress toprintuseloader.print('string to print')UsewithstatementRecommendedwithLoader(message='Dummy bar')asloader:# codepassThe bar will auto complete when on exitingwithstatementYou may also exit usingloader.completeorloader.fail()Decoratorfromschnittstelleimportdecorators@decorators.Loader(message='foo bar')deffoo(s):# codeEverytime the function is called loader will appearIn case of exception it is caught and runs the fail method of loaderUsing this method you're not able to access loader class itselfInlineloader=Loader().init()# codeloader.complete()# or loader.fail()Exit the progress bar usingloader.completeorloader.fail()RunnableNot recommendeddeffoo(s):# coderunnable=RunnableLoader(foo,message='foo bar')runnable.run('foo')All arguments go into run methodIn case of exception it is caught and runs the fail method of loaderUsing this method you're not able to access loader class itselfConfigurationsTo change the configurations at runtime useloader.brush.[configuration]syntaxconfigurations need to be passed into class initiator as keyword argumentsvalueCurrent value of progressIf this value is less than 0, the progress bar isindeterminatetotalTotal progress for the barmessageMessage label to display on progress barIn the above example it isDummy barfrequencyNumber of refreshes per secondThis will determine thespeedof the progress bar as wellIf frequency is too low, progress bar might not show progress as intendeddefaultis 20 refreshes per secstyleTakes in classLoaderStyleLoaderStyleStatic Constuctorsdefaultdefault settingsasciionly containing ascii charsAttributeswidthwidth of the progress bardefault: 5cursor_widthFill width of indeterminate progress bardefault: 3fillFill indicator charactordefault: FULL_BLOCKemptyempty indicator charactordefault: SPACEprefixcharacter before progress bardefault: [postfixcharacter after progress bardefault: ]