From 774940bbfec258fd768070637196a917909b5aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Sun, 5 May 2019 09:30:05 +0200 Subject: [PATCH] Activate buffer only in frozen version --- CurseBreaker.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CurseBreaker.py b/CurseBreaker.py index 86582ab..459850b 100644 --- a/CurseBreaker.py +++ b/CurseBreaker.py @@ -160,11 +160,14 @@ def print_header(self): f'{__version__} ~~~\n')) def setup_console(self, buffer=False): - if buffer: - windll.kernel32.SetConsoleScreenBufferSize(self.chandle, wintypes._COORD(100, 100)) + if getattr(sys, 'frozen', False): + if buffer: + windll.kernel32.SetConsoleScreenBufferSize(self.chandle, wintypes._COORD(100, 100)) + else: + windll.kernel32.SetConsoleWindowInfo(self.chandle, True, byref(wintypes.SMALL_RECT(0, 0, 99, 49))) + windll.kernel32.SetConsoleScreenBufferSize(self.chandle, wintypes._COORD(100, 50)) else: - windll.kernel32.SetConsoleWindowInfo(self.chandle, True, byref(wintypes.SMALL_RECT(0, 0, 99, 49))) - windll.kernel32.SetConsoleScreenBufferSize(self.chandle, wintypes._COORD(100, 50)) + os.system('mode con: cols=100 lines=50') def setup_completer(self): commands = ['install', 'uninstall', 'update', 'force_update', 'status', 'orphans', 'search', 'toggle_backup',