|
| 1 | +# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*- |
| 2 | +# vim: tabstop=2:shiftwidth=2:noexpandtab |
| 3 | +# kate: tab-width 2; replace-tabs off; indent-width 2; |
| 4 | +# ============================================================================= |
| 5 | +# _____ _ _ _ _ ___ |
| 6 | +# _ __ _ |_ _|__ _ __ _ __ ___ (_)_ __ __ _| | | | |_ _| |
| 7 | +# | '_ \| | | || |/ _ \ '__| '_ ` _ \| | '_ \ / _` | | | | || | |
| 8 | +# | |_) | |_| || | __/ | | | | | | | | | | | (_| | | |_| || | |
| 9 | +# | .__/ \__, ||_|\___|_| |_| |_| |_|_|_| |_|\__,_|_|\___/|___| |
| 10 | +# |_| |___/ |
| 11 | +# ============================================================================= |
| 12 | +# Authors: Patrick Lehmann |
| 13 | +# |
| 14 | +# Python module: A test application for pyTerminalUI. |
| 15 | +# |
| 16 | +# Description: |
| 17 | +# ------------------------------------ |
| 18 | +# TODO |
| 19 | +# |
| 20 | +# License: |
| 21 | +# ============================================================================ |
| 22 | +# Copyright 2017-2019 Patrick Lehmann - Bötzingen, Germany |
| 23 | +# |
| 24 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 25 | +# you may not use this file except in compliance with the License. |
| 26 | +# You may obtain a copy of the License at |
| 27 | +# |
| 28 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 29 | +# |
| 30 | +# Unless required by applicable law or agreed to in writing, software |
| 31 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 32 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 33 | +# See the License for the specific language governing permissions and |
| 34 | +# limitations under the License. |
| 35 | +# |
| 36 | +# SPDX-License-Identifier: Apache-2.0 |
| 37 | +# ============================================================================ |
| 38 | +# |
| 39 | +import os |
| 40 | +import sys |
| 41 | +sys.path.insert(0, os.path.abspath('..')) |
| 42 | + |
| 43 | +from pyTerminalUI import LineTerminal, Severity |
| 44 | + |
| 45 | + |
| 46 | +class Application(LineTerminal): |
| 47 | + def __init__(self): |
| 48 | + super().__init__(Severity.All) |
| 49 | + |
| 50 | + def run(self): |
| 51 | + self.WriteQuiet("This is a quiet message.") |
| 52 | + self.WriteNormal("This is a normal message.") |
| 53 | + self.WriteInfo("This is a info message.") |
| 54 | + self.WriteDebug("This is a debug message.") |
| 55 | + self.WriteWarning("This is a warning message.") |
| 56 | + self.WriteError("This is an error message.") |
| 57 | + self.WriteFatal("This is a fatal message.") |
| 58 | + |
| 59 | +# entry point |
| 60 | +if __name__ == "__main__": |
| 61 | + app = Application() |
| 62 | + app.run() |
| 63 | + app.exit() |
0 commit comments