From 471720b56eebffd9939154a3ea56e3a8c33c465c Mon Sep 17 00:00:00 2001 From: Jake Funke Date: Mon, 27 Mar 2017 18:28:00 +0000 Subject: [PATCH] Add ISC license and code cleanup --- LICENSE | 15 +++++++++++++++ menu_screen.py | 19 ++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..028d4b3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2017, Jacob Funke + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/menu_screen.py b/menu_screen.py index e96491d..4cf42b3 100644 --- a/menu_screen.py +++ b/menu_screen.py @@ -189,7 +189,7 @@ class CursedMenu(object): # don't allow negative value water_left_pct = max(0, water_left_pct) water_left = int(math.ceil(water_left_pct * 10)) - water_string = "(" + (")" * water_left) + ("." * (10 - water_left)) + ") " + str(int(water_left_pct * 100)) + "%" + water_string = "(" + (")" * water_left) + ("." * (10 - water_left)) + ") " + str(int(water_left_pct * 100)) + "% " return water_string @@ -441,14 +441,15 @@ class CursedMenu(object): # Draw instructions on screen self.clear_info_pane() if self.infotoggle != 4: - instructions_txt = """welcome to botany. you've been given a seed -that will grow into a beautiful plant. check -in and water your plant every 24h to keep it -growing. 5 days without water = death. your -plant depends on you to live! more info is -available in the readme :) - cheers, - curio""" + instructions_txt = ("welcome to botany. you've been given a seed\n" + "that will grow into a beautiful plant. check\n" + "in and water your plant every 24h to keep it\n" + "growing. 5 days without water = death. your\n" + "plant depends on you to live! more info is\n" + "available in the readme :)\n" + " cheers,\n" + " curio\n" + ) self.draw_info_text(instructions_txt) self.infotoggle = 4 else: