From 1e290a1f26f4188e188e741099c4bf36f6b38a14 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Tue, 11 Oct 2022 09:22:40 -0400 Subject: [PATCH] Only import rarely used modules when they're needed Former-commit-id: 1ec2f9c6884f0e06b32d693c38ffe5c698b7dc52 [formerly 8642601eeed5181a23c7ae64f2dcabac278d0652] Former-commit-id: d5078e981c24350843ec99597cbbfed619f555bf --- lib/sshyp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index f487b64..a9fa9e4 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -7,15 +7,14 @@ from pathlib import Path from random import randint, SystemRandom from shutil import get_terminal_size, move, rmtree import sshync -import string from subprocess import CalledProcessError, Popen, PIPE, run from sys import argv, exit as s_exit -from textwrap import fill # BELOW - utility functions def entry_list_gen(_directory=path.expanduser('~/.local/share/sshyp/')): # generates and prints full entry list + from textwrap import fill print('\n\u001b[38;5;0;48;5;15msshyp entries:\u001b[0m\n') _entry_list, _color_alternator = [], 1 for _entry in sorted(listdir(_directory)): @@ -100,6 +99,7 @@ def entry_name_fetch(_entry_name_location): # fetches and returns entry name fr def string_gen(_complexity, _length): # generates and returns a random string based on input + import string if _complexity == 's': _character_pool = string.ascii_letters + string.digits else: