diff --git a/slpkg/auto_pkg.py b/slpkg/auto_pkg.py index 905eb8ff..93520747 100644 --- a/slpkg/auto_pkg.py +++ b/slpkg/auto_pkg.py @@ -65,10 +65,10 @@ class Auto(object): print("") raise SystemExit() if self.choice in self.commands.keys(): - sys.stdout.write(" \x1b[1A{0}{1}{2}\n\n".format( + print(" \x1b[1A{0}{1}{2}\n\n".format( self.meta.color["CYAN"], self.commands[self.choice], - self.meta.color["ENDC"])) - sys.stdout.flush() + self.meta.color["ENDC"]), end="") + print(end="", flush=True) self.execute() def execute(self): diff --git a/slpkg/init.py b/slpkg/init.py index 0e8d8633..296fba50 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -770,13 +770,13 @@ class Update(object): for repo in enabled: if check_for_local_repos(repo) is True: continue - sys.stdout.write("{0}Check repository [{1}{2}{3}] ... " + print("{0}Check repository [{1}{2}{3}] ... " "{4}".format( self.meta.color["GREY"], self.meta.color["CYAN"], repo, self.meta.color["GREY"], - self.meta.color["ENDC"])) - sys.stdout.flush() + self.meta.color["ENDC"]), end="") + print(end="", flush=True) if repo in default: exec("{0}.{1}()".format(self._init, repo)) sys.stdout.write(self.done) diff --git a/slpkg/messages.py b/slpkg/messages.py index 97643865..18ee1e71 100644 --- a/slpkg/messages.py +++ b/slpkg/messages.py @@ -70,23 +70,23 @@ class Msg(object): def checking(self): """Message checking """ - sys.stdout.write("{0}Checking...{1} ".format(self.meta.color["GREY"], - self.meta.color["ENDC"])) - sys.stdout.flush() + print("{0}Checking...{1} ".format(self.meta.color["GREY"], + self.meta.color["ENDC"]), end="") + print(end="", flush=True) def reading(self): """Message reading """ - sys.stdout.write("{0}Reading package lists...{1} ".format( - self.meta.color["GREY"], self.meta.color["ENDC"])) - sys.stdout.flush() + print("{0}Reading package lists...{1} ".format( + self.meta.color["GREY"], self.meta.color["ENDC"]), end="") + print(end="", flush=True) def resolving(self): """Message resolving """ - sys.stdout.write("{0}Resolving dependencies...{1} ".format( - self.meta.color["GREY"], self.meta.color["ENDC"])) - sys.stdout.flush() + print("{0}Resolving dependencies...{1} ".format( + self.meta.color["GREY"], self.meta.color["ENDC"]), end="") + print(end="", flush=True) def done(self): """Message done diff --git a/slpkg/sbo/network.py b/slpkg/sbo/network.py index 5ba6b689..e9dcaec6 100644 --- a/slpkg/sbo/network.py +++ b/slpkg/sbo/network.py @@ -177,10 +177,10 @@ class SBoNetwork(object): print("") raise SystemExit() try: - sys.stdout.write("{0}\x1b[1A{1}{2}{3}\n".format( + print("{0}\x1b[1A{1}{2}{3}\n".format( " " * len(message), self.cyan, commands[self.choice], - self.endc)) - sys.stdout.flush() + self.endc), end="") + print(end="", flush=True) except KeyError: pass diff --git a/slpkg/status_deps.py b/slpkg/status_deps.py index 66d76cb8..a275f68f 100644 --- a/slpkg/status_deps.py +++ b/slpkg/status_deps.py @@ -111,8 +111,8 @@ class DependenciesStatus(object): for d in dep: print("+-- {0}".format(d)) print("|") - sys.stdout.write("\x1b[1A{0}\n".format(" ")) - sys.stdout.flush() + print("\x1b[1A{0}\n".format(" "), end="") + print(end="", flush=True) self.summary() if self.image: Graph(self.image).dependencies(self.dmap) diff --git a/slpkg/toolbar.py b/slpkg/toolbar.py index f50fece8..485030da 100644 --- a/slpkg/toolbar.py +++ b/slpkg/toolbar.py @@ -34,7 +34,7 @@ def status(sec): if _meta_.prg_bar in ["on", "ON"]: syms = ["|", "/", "-", "\\"] for sym in syms: - sys.stdout.write("\b{0}{1}{2}".format(_meta_.color["GREY"], sym, - _meta_.color["ENDC"])) - sys.stdout.flush() + print("\b{0}{1}{2}".format(_meta_.color["GREY"], sym, + _meta_.color["ENDC"]), end="") + print(end="", flush=True) time.sleep(float(sec))